Opened 18 years ago
Closed 16 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 |
Description
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)
Change History (4)
by , 18 years ago
| Attachment: | single_feed.diff added |
|---|
comment:1 by , 18 years ago
| Cc: | 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 , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Implementation of single_feed()