class documentation
class SyndicationFeed: (source)
Known subclasses: django.utils.feedgenerator.Atom1Feed
, django.utils.feedgenerator.RssFeed
Base class for all syndication feeds. Subclasses should provide write()
Method | __init__ |
Undocumented |
Method | add |
Add an item to the feed. All args are expected to be strings except pubdate and updateddate, which are datetime.datetime objects, and enclosures, which is an iterable of instances of the Enclosure class. |
Method | add |
Add elements on each item (i.e. item/entry) element. |
Method | add |
Add elements in the root (i.e. feed/channel) element. Called from write(). |
Method | item |
Return extra attributes to place on each item (i.e. item/entry) element. |
Method | latest |
Return the latest item's pubdate or updateddate. If no items have either of these attributes this return the current UTC date/time. |
Method | num |
Undocumented |
Method | root |
Return extra attributes to place on the root (i.e. feed/channel) element. Called from write(). |
Method | write |
Output the feed in the given encoding to outfile, which is a file-like object. Subclasses should override this. |
Method | write |
Return the feed in the given encoding as a string. |
Instance Variable | feed |
Undocumented |
Instance Variable | items |
Undocumented |
def __init__(self, title, link, description, language=None, author_email=None, author_name=None, author_link=None, subtitle=None, categories=None, feed_url=None, feed_copyright=None, feed_guid=None, ttl=None, **kwargs):
(source)
¶
Undocumented
def add_item(self, title, link, description, author_email=None, author_name=None, author_link=None, pubdate=None, comments=None, unique_id=None, unique_id_is_permalink=None, categories=(), item_copyright=None, ttl=None, updateddate=None, enclosures=None, **kwargs):
(source)
¶
Add an item to the feed. All args are expected to be strings except pubdate and updateddate, which are datetime.datetime objects, and enclosures, which is an iterable of instances of the Enclosure class.
overridden in
django.utils.feedgenerator.Atom1Feed
, django.utils.feedgenerator.Rss201rev2Feed
, django.utils.feedgenerator.RssUserland091Feed
Add elements on each item (i.e. item/entry) element.
Return the latest item's pubdate or updateddate. If no items have either of these attributes this return the current UTC date/time.
overridden in
django.utils.feedgenerator.Atom1Feed
Return extra attributes to place on the root (i.e. feed/channel) element. Called from write().