My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
LegacyGuide  
how to use atom.py if you are using Django's existing feed generator
Featured
Updated Feb 4, 2010 by jtau...@gmail.com

Legacy Guide For People With Existing Feeds

If you are starting from scratch, you don't need to read this and can just read the UserGuide.

If Directly Calling Subclass of SyndicationFeed

If 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:

  • replace any reference to the SyndicationFeed subclass with LegacySyndicationFeed from atom.py.

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 Feed

If 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
Powered by Google Project Hosting