Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#1294 closed enhancement (invalid)

RSS framework doesn't pick up item_author_name

Reported by: jaanus@… 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 k.shaposhnikov@…, 18 years ago

This is because of following code in feedgenerator.py (Rss201rev2Feed class):

            # Author information.
            if item['author_email'] is not None and item['author_name'] is not None:
                handler.addQuickElement(u"author", u"%s (%s)" % \
                    (item['author_email'], item['author_name']))

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.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

Django follows the spec, so I'm marking this as invalid.

comment:3 by anonymous, 18 years ago

Component: RSS frameworkUnit test system
milestone: Version 1.1
priority: normallowest
Severity: normalblocker
Type: defectenhancement
Version: SVNnew-admin

comment:4 by (none), 17 years ago

Milestone Version 1.1 deleted

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