Code

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1294 closed enhancement (invalid)

RSS framework doesn't pick up item_author_name

Reported by: jaanus@… Owned by: adrian
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: UI/UX:

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???

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by k.shaposhnikov@…

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 Changed 8 years ago by adrian

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:3 Changed 8 years ago by anonymous

  • Component changed from RSS framework to Unit test system
  • milestone set to Version 1.1
  • priority changed from normal to lowest
  • Severity changed from normal to blocker
  • Type changed from defect to enhancement
  • Version changed from SVN to new-admin

comment:4 Changed 7 years ago by anonymous

Milestone Version 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.