Ticket #447: rss-pubdate.diff

File rss-pubdate.diff, 1.6 KB (added by benno@…, 19 years ago)
  • django/core/rss.py

     
    88class FeedConfiguration:
    99    def __init__(self, slug, title_cb, link_cb, description_cb, get_list_func_cb, get_list_kwargs,
    1010        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):
    1212        """
    1313        slug -- Normal Python string. Used to register the feed.
    1414
     
    2929        get_list_kwargs_cb -- Function that takes the param and returns a
    3030        dictionary to use in addition to get_list_kwargs (if applicable).
    3131
     32        get_pubdate_cb -- Function that takes the object and returns a
     33        datetime to use as the publication date.
     34
    3235        The three enc_* parameters are strings representing methods or
    3336        attributes to call on a particular item to get its enclosure
    3437        information. Each of those methods/attributes should return a normal
     
    4548        self.enc_url = enc_url
    4649        self.enc_length = enc_length
    4750        self.enc_mime_type = enc_mime_type
     51        self.get_pubdate_cb = get_pubdate_cb
    4852       
    4953    def get_feed(self, param_slug=None):
    5054        """
     
    9599                description = description_template.render(Context({'obj': obj, 'site': current_site})).decode('utf-8'),
    96100                unique_id=link,
    97101                enclosure=enc,
     102                pubdate=self.get_pubdate_cb(obj)
    98103            )
    99104        return f
    100105       
Back to Top