Changeset 5643
- Timestamp:
- 07/10/07 07:33:55 (1 year ago)
- Files:
-
- django/trunk/django/contrib/syndication/feeds.py (modified) (2 diffs)
- django/trunk/django/utils/feedgenerator.py (modified) (3 diffs)
- django/trunk/docs/syndication_feeds.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/syndication/feeds.py
r5629 r5643 84 84 categories = self.__get_dynamic_attr('categories', obj), 85 85 feed_copyright = self.__get_dynamic_attr('feed_copyright', obj), 86 feed_guid = self.__get_dynamic_attr('feed_guid', obj), 86 87 ) 87 88 … … 115 116 link = link, 116 117 description = description_tmp.render(Context({'obj': item, 'site': current_site})), 117 unique_id = link,118 unique_id = self.__get_dynamic_attr('item_guid', item, link), 118 119 enclosure = enc, 119 120 pubdate = self.__get_dynamic_attr('item_pubdate', item), django/trunk/django/utils/feedgenerator.py
r5609 r5643 42 42 def __init__(self, title, link, description, language=None, author_email=None, 43 43 author_name=None, author_link=None, subtitle=None, categories=None, 44 feed_url=None, feed_copyright=None ):44 feed_url=None, feed_copyright=None, feed_guid=None): 45 45 to_unicode = lambda s: force_unicode(s, strings_only=True) 46 46 if categories: … … 58 58 'feed_url': iri_to_uri(feed_url), 59 59 'feed_copyright': to_unicode(feed_copyright), 60 'id': feed_guid or link, 60 61 } 61 62 self.items = [] … … 214 215 if self.feed['feed_url'] is not None: 215 216 handler.addQuickElement(u"link", "", {u"rel": u"self", u"href": self.feed['feed_url']}) 216 handler.addQuickElement(u"id", self.feed[' link'])217 handler.addQuickElement(u"id", self.feed['id']) 217 218 handler.addQuickElement(u"updated", rfc3339_date(self.latest_post_date()).decode('ascii')) 218 219 if self.feed['author_name'] is not None: django/trunk/docs/syndication_feeds.txt
r5250 r5643 417 417 link = '/foo/bar/' # Hard-coded link. 418 418 419 # GUID -- One of the following three is optional. The framework looks 420 # for them in this order. This property is only used for Atom feeds 421 # (where it is the feed-level id element). If not provided, the feed 422 # link is used as the id. 423 424 def feed_guid(self, obj): 425 """ 426 Takes the object returned by get_object() and returns the globally 427 unique id for the feed as a normal Python string. 428 """ 429 430 def feed_guid(self): 431 """ 432 Returns the feed's globally unique id as a normal Python string. 433 """ 434 435 feed_guid = '/foo/bar/1234' # Hard-coded guid. 436 419 437 # DESCRIPTION -- One of the following three is required. The framework 420 438 # looks for them in this order. … … 555 573 """ 556 574 Returns the URL for every item in the feed. 575 """ 576 577 # ITEM_GUID -- The following method is optional. This property is 578 # only used for Atom feeds (it is the id element for an item in an 579 # Atom feed). If not provided, the item's link is used by default. 580 581 def item_guid(self, obj): 582 """ 583 Takes an item, as return by items(), and returns the item's id. 557 584 """ 558 585
