Changeset 3143
- Timestamp:
- 06/18/06 20:38:06 (2 years ago)
- Files:
-
- django/trunk/django/contrib/syndication/feeds.py (modified) (2 diffs)
- django/trunk/django/utils/feedgenerator.py (modified) (1 diff)
- django/trunk/docs/syndication_feeds.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/syndication/feeds.py
r3113 r3143 74 74 author_link = self.__get_dynamic_attr('author_link', obj), 75 75 author_email = self.__get_dynamic_attr('author_email', obj), 76 categories = self.__get_dynamic_attr('categories', obj), 76 77 ) 77 78 … … 111 112 author_email = author_email, 112 113 author_link = author_link, 114 categories = self.__get_dynamic_attr('item_categories', item), 113 115 ) 114 116 return feed django/trunk/django/utils/feedgenerator.py
r3113 r3143 127 127 if self.feed['language'] is not None: 128 128 handler.addQuickElement(u"language", self.feed['language']) 129 for cat in self.feed['categories']: 130 handler.addQuickElement(u"category", cat) 129 131 self.write_items(handler) 130 132 self.endChannelElement(handler) django/trunk/docs/syndication_feeds.txt
r2809 r3143 440 440 author_link = 'http://www.example.com/' # Hard-coded author URL. 441 441 442 # CATEGORIES -- One of the following three is optional. The framework 443 # looks for them in this order. In each case, the method/attribute 444 # should return an iterable object that returns strings. 445 446 def categories(self, obj): 447 """ 448 Takes the object returned by get_object() and returns the feed's 449 categories as iterable over strings. 450 """ 451 452 def categories(self): 453 """ 454 Returns the feed's categories as iterable over strings. 455 """ 456 457 categories = ("python", "django") # Hard-coded list of categories. 458 442 459 # ITEMS -- One of the following three is required. The framework looks 443 460 # for them in this order. … … 602 619 603 620 item_pubdate = datetime.datetime(2005, 5, 3) # Hard-coded pubdate. 621 622 # ITEM CATEGORIES -- It's optional to use one of these three. This is 623 # a hook that specifies how to get the list of categories for a given 624 # item. In each case, the method/attribute should return an iterable 625 # object that returns strings. 626 627 def item_categories(self, item): 628 """ 629 Takes an item, as returned by items(), and returns the item's 630 categories. 631 """ 632 633 def item_categories(self): 634 """ 635 Returns the categories for every item in the feed. 636 """ 637 638 item_categories = ("python", "django") # Hard-coded categories. 639 604 640 605 641 The low-level framework
