#2158 closed enhancement (fixed)
[patch] Syndication framework doesn't allow custom template paths.
Reported by: | James Wheare | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Contrib apps | Version: | dev |
Severity: | normal | Keywords: | syndication, feeds, templates, urls |
Cc: | django@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Let me illustrate this with an example.
I have two sorts of feeds in my app:
/authors/feed/ # simple feed of all authors
/authors/authorname/feed/ # complex per-author feed
Defined by the following URLconf
feeds = { 'authors': AuthorsFeed, } author_feed = { 'authors': AuthorFeed, } (r'^(?P<url>authors/[-\w]+)/feed/$', 'feed', {'feed_dict': author_feed}), (r'^(?P<url>authors)/feed/$', 'feed', {'feed_dict': feeds}),
The problem is that both urls share the same slug "authors" which determines the feed model to use and—more critically—the template paths (authors_description, authors_title)
I managed to work around the model issue by specifying two different feed_dicts but I can't see a way to specify different templates for each feed without patching django.contrib.syndication.views.
Attachments (1)
Change History (10)
comment:1 by , 19 years ago
Cc: | added |
---|
by , 19 years ago
Attachment: | syndication.diff added |
---|
comment:2 by , 19 years ago
Severity: | major → normal |
---|---|
Summary: | Syndication framework doesn't allow custom template paths for description and title per feed url. → [patch] Syndication framework doesn't allow custom template paths. |
comment:3 by , 19 years ago
I'm sure this patch is a really hackish way of doing this and the variable names are awful but at least it works.
comment:4 by , 19 years ago
Ack! Ignore "comments_extras.diff". I accidentally attached that to the wrong ticket. My apologies.
comment:7 by , 19 years ago
Actually, it *is* using 4 spaces, trac seems to be screwing the formatting it up, check the raw format. (And yes, I figured out the textmate issue, stupid me)
comment:8 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Added ability to specify title and description templates