Changeset 6570
- Timestamp:
- 10/20/07 09:54:38 (10 months ago)
- Files:
-
- django/trunk/AUTHORS (modified) (2 diffs)
- django/trunk/django/contrib/syndication/feeds.py (modified) (1 diff)
- django/trunk/django/utils/feedgenerator.py (modified) (6 diffs)
- django/trunk/docs/syndication_feeds.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/AUTHORS
r6557 r6570 171 171 Ben Dean Kawamura <ben.dean.kawamura@gmail.com> 172 172 Ian G. Kelly <ian.g.kelly@gmail.com> 173 Thomas Kerpe <thomas@kerpe.net> 173 174 Ben Khoo <khoobks@westnet.com.au> 174 175 Garth Kidd <http://www.deadlybloodyserious.com/> … … 274 275 John Shaffer <jshaffer2112@gmail.com> 275 276 Pete Shinners <pete@shinners.org> 277 jason.sidabras@gmail.com 276 278 Jozko Skrablin <jozko.skrablin@gmail.com> 277 279 SmileyChris <smileychris@gmail.com> django/trunk/django/contrib/syndication/feeds.py
r5654 r6570 90 90 feed_copyright = self.__get_dynamic_attr('feed_copyright', obj), 91 91 feed_guid = self.__get_dynamic_attr('feed_guid', obj), 92 ttl = self.__get_dynamic_attr('ttl', obj), 92 93 ) 93 94 django/trunk/django/utils/feedgenerator.py
r6268 r6570 46 46 def __init__(self, title, link, description, language=None, author_email=None, 47 47 author_name=None, author_link=None, subtitle=None, categories=None, 48 feed_url=None, feed_copyright=None, feed_guid=None ):48 feed_url=None, feed_copyright=None, feed_guid=None, ttl=None): 49 49 to_unicode = lambda s: force_unicode(s, strings_only=True) 50 50 if categories: … … 63 63 'feed_copyright': to_unicode(feed_copyright), 64 64 'id': feed_guid or link, 65 'ttl': ttl, 65 66 } 66 67 self.items = [] … … 68 69 def add_item(self, title, link, description, author_email=None, 69 70 author_name=None, author_link=None, pubdate=None, comments=None, 70 unique_id=None, enclosure=None, categories=(), item_copyright=None ):71 unique_id=None, enclosure=None, categories=(), item_copyright=None, ttl=None): 71 72 """ 72 73 Adds an item to the feed. All args are expected to be Python Unicode … … 90 91 'categories': categories or (), 91 92 'item_copyright': to_unicode(item_copyright), 93 'ttl': ttl, 92 94 }) 93 95 … … 147 149 handler.addQuickElement(u"copyright", self.feed['feed_copyright']) 148 150 handler.addQuickElement(u"lastBuildDate", rfc2822_date(self.latest_post_date()).decode('ascii')) 151 if self.feed['ttl'] is not None: 152 handler.addQuickElement(u"ttl", self.feed['ttl']) 149 153 self.write_items(handler) 150 154 self.endChannelElement(handler) … … 191 195 if item['unique_id'] is not None: 192 196 handler.addQuickElement(u"guid", item['unique_id']) 197 if item['ttl'] is not None: 198 handler.addQuickElement(u"ttl", item['ttl']) 193 199 194 200 # Enclosure. django/trunk/docs/syndication_feeds.txt
r5654 r6570 548 548 copyright = 'Copyright (c) 2007, Sally Smith' # Hard-coded copyright notice. 549 549 550 # TTL -- One of the following three is optional. The framework looks 551 # for them in this order. Ignored for Atom feeds. 552 553 def ttl(self, obj): 554 """ 555 Takes the object returned by get_object() and returns the feed's 556 TTL (Time to live) as a normal Python string. 557 """ 558 559 def ttl(self): 560 """ 561 Returns the feed's ttl as a normal Python string. 562 """ 563 564 ttl = 600 # Hard-coded Time to live. 565 550 566 # ITEMS -- One of the following three is required. The framework looks 551 567 # for them in this order.
