#1294 closed enhancement (invalid)
RSS framework doesn't pick up item_author_name
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Testing framework | Version: | new-admin |
Severity: | blocker | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Code:
class LatestFeed(Feed): title = 'Chat feed title' link = 'http://www.example.com' description = 'Chat feed' def get_object(self, bits): if len(bits) != 1: raise ObjectDoesNotExist return chats.get_object(name__exact=bits[0]) def items(self, obj): return messages.get_list(chatname__exact=obj.name, order_by=('-timestamp',), limit=50) def item_pubdate(self, item): return item.timestamp def item_author_name(self, item): return item.from_dispname
output:
<item> <title>title is fine here</title> <link>http://the_link_is_fine.com</link> <description>here's some text</description> <pubDate>Fri, 27 Jan 2006 15:15:58 -0000</pubDate> <guid>http://the_link_is_fine.com</guid> </item>
no trace of author in the output???
Change History (4)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Django follows the spec, so I'm marking this as invalid.
comment:3 by , 18 years ago
Component: | RSS framework → Unit test system |
---|---|
milestone: | → Version 1.1 |
priority: | normal → lowest |
Severity: | normal → blocker |
Type: | defect → enhancement |
Version: | SVN → new-admin |
Note:
See TracTickets
for help on using tickets.
This is because of following code in feedgenerator.py (Rss201rev2Feed class):
As you can see you should specify both author_email and author_name for your item, at least if you want to generate RSS 2.0 feed.
I am not sure what is the best way to fix it, so I won't provide patch.
RSS specification (http://blogs.law.harvard.edu/tech/rss#ltauthorgtSubelementOfLtitemgt) describes behavior that implemented in Django. But probably it is valid if author element contains only name or only email.