Ticket #447: rss-pubdate.diff
File rss-pubdate.diff, 1.6 KB (added by , 19 years ago) |
---|
-
django/core/rss.py
8 8 class FeedConfiguration: 9 9 def __init__(self, slug, title_cb, link_cb, description_cb, get_list_func_cb, get_list_kwargs, 10 10 param_func=None, param_kwargs_cb=None, get_list_kwargs_cb=None, 11 enc_url=None, enc_length=None, enc_mime_type=None):11 get_pubdate_cb=None, enc_url=None, enc_length=None, enc_mime_type=None): 12 12 """ 13 13 slug -- Normal Python string. Used to register the feed. 14 14 … … 29 29 get_list_kwargs_cb -- Function that takes the param and returns a 30 30 dictionary to use in addition to get_list_kwargs (if applicable). 31 31 32 get_pubdate_cb -- Function that takes the object and returns a 33 datetime to use as the publication date. 34 32 35 The three enc_* parameters are strings representing methods or 33 36 attributes to call on a particular item to get its enclosure 34 37 information. Each of those methods/attributes should return a normal … … 45 48 self.enc_url = enc_url 46 49 self.enc_length = enc_length 47 50 self.enc_mime_type = enc_mime_type 51 self.get_pubdate_cb = get_pubdate_cb 48 52 49 53 def get_feed(self, param_slug=None): 50 54 """ … … 95 99 description = description_template.render(Context({'obj': obj, 'site': current_site})).decode('utf-8'), 96 100 unique_id=link, 97 101 enclosure=enc, 102 pubdate=self.get_pubdate_cb(obj) 98 103 ) 99 104 return f 100 105