Ticket #9800: rss-guid_is_permalink-attribute.diff
File rss-guid_is_permalink-attribute.diff, 2.2 KB (added by , 14 years ago) |
---|
-
django/utils/feedgenerator.py
71 71 "Base class for all syndication feeds. Subclasses should provide write()" 72 72 def __init__(self, title, link, description, language=None, author_email=None, 73 73 author_name=None, author_link=None, subtitle=None, categories=None, 74 feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs):74 feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, guid_is_permalink=None, **kwargs): 75 75 to_unicode = lambda s: force_unicode(s, strings_only=True) 76 76 if categories: 77 77 categories = [force_unicode(c) for c in categories] … … 92 92 'feed_copyright': to_unicode(feed_copyright), 93 93 'id': feed_guid or link, 94 94 'ttl': ttl, 95 'guid_is_permalink': guid_is_permalink, 95 96 } 96 97 self.feed.update(kwargs) 97 98 self.items = [] … … 264 265 if item['comments'] is not None: 265 266 handler.addQuickElement(u"comments", item['comments']) 266 267 if item['unique_id'] is not None: 267 handler.addQuickElement(u"guid", item['unique_id']) 268 guid_attrs = {} 269 if isinstance(self.feed['guid_is_permalink'], bool): 270 guid_attrs['isPermalink'] = str(self.feed['guid_is_permalink']).lower() 271 handler.addQuickElement(u"guid", item['unique_id'], guid_attrs) 268 272 if item['ttl'] is not None: 269 273 handler.addQuickElement(u"ttl", item['ttl']) 270 274 -
django/contrib/syndication/views.py
118 118 feed_copyright = self.__get_dynamic_attr('feed_copyright', obj), 119 119 feed_guid = self.__get_dynamic_attr('feed_guid', obj), 120 120 ttl = self.__get_dynamic_attr('ttl', obj), 121 guid_is_permalink = self.__get_dynamic_attr('guid_is_permalink', obj), 121 122 **self.feed_extra_kwargs(obj) 122 123 ) 123 124