Opened 16 years ago

Closed 14 years ago

#6304 closed (fixed)

Syndication feed framework should allow for parsing of URLs in the URLconf

Reported by: Adrian Holovaty Owned by: nobody
Component: contrib.syndication Version: dev
Severity: Keywords:
Cc: floguy@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently, the syndication feed framework requires the developer to parse URLs manually in Feed.get_object(), which violates the DRY principle and is confusing because it leads to URL parsing being in more than one place (i.e., in a place other than the URLconf). I am proposing a new view in django.contrib.syndication.views, called single_feed(), which allows for parsing the URL in the URLconf instead of Feed.get_object().

The problem with this patch, which I realized only after implementing it, is that it couples Feed to either single_feed() or multiple_feeds(). We could change Feed.get_object() to *always* take a list of URL parameters, but that would be a backwards-incompatibility. I'm posting my patch here for discussion.

Attachments (1)

single_feed.diff (7.0 KB ) - added by Adrian Holovaty 16 years ago.
Implementation of single_feed()

Download all attachments as: .zip

Change History (4)

by Adrian Holovaty, 16 years ago

Attachment: single_feed.diff added

Implementation of single_feed()

comment:1 by floguy, 16 years ago

Cc: floguy@… added

The idea of moving as much URL parsing into the URLconf as possible seems like a good one, as I've had a hard time with this before too. As long as it's here for discussion, I'd like to bring up that this is done in a few contrib apps (databrowse and newforms-admin's admin come to mind). Maybe a policy w.r.t. this practice should be decided before 1.0.

comment:2 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

(In [12338]) Fixed #6188, #6304, #6618, #6969, #8758, #8989, #10334, #11069, #11973 and #12403 -- Modified the syndication framework to use class-based views. Thanks to Ben Firshman for his work on this patch.

Note: See TracTickets for help on using tickets.
Back to Top