|
LegacyGuide
how to use atom.py if you are using Django's existing feed generator
Legacy Guide For People With Existing FeedsIf you are starting from scratch, you don't need to read this and can just read the UserGuide. If Directly Calling Subclass of SyndicationFeedIf you are currently creating a SyndicationFeed (like RssFeed or Atom1Feed) directly and calling add_item to populate it with items, all you need to do is:
So, in other words, if you are currently doing: from django.utils.feedgenerator import RssFeed my_feed = RssFeed(...) my_feed.add_item(...) my_feed.add_item(...) ... you can replace this with from atom import LegacySyndicationFeed my_feed = LegacySyndicationFeed(...) my_feed.add_item(...) my_feed.add_item(...) ... or even from atom import LegacySyndicationFeed as RssFeed my_feed = RssFeed(...) my_feed.add_item(...) my_feed.add_item(...) ... If Subclassing FeedIf you are currently subclassing django.contrib.syndication.Feed, I'm still working on a drop-in replacement. Contact me if you're interested in helping test it. Note: it's possible that just setting feed_type = LegacySyndicationFeed will work but I haven't tested it. |
Sign in to add a comment