<s> from django . core . exceptions import ObjectDoesNotExist <EOL> from django . contrib . syndication import feeds <EOL> from django . utils . feedgenerator import Atom1Feed <EOL> class ComplexFeed ( feeds . Feed ) : <EOL> def get_object ( self , bits ) : <EOL> if len ( bits ) != <NUM_LIT:1> : <EOL> raise ObjectDoesNotExist <EOL> return None <EOL> class TestRssFeed ( feeds . Feed ) : <EOL> link = "<STR_LIT>" <EOL> title = '<STR_LIT>' <EOL> def items ( self ) : <EOL> from models import Entry <EOL> return Entry . objects . all ( ) <EOL> def item_link ( self , item ) : <EOL> return "<STR_LIT>" % item . pk <EOL> class TestAtomFeed ( TestRssFeed ) : <EOL> feed_type = Atom1Feed <EOL> class MyCustomAtom1Feed ( Atom1Feed ) : <EOL> """<STR_LIT>""" <EOL> def root_attributes ( self ) : <EOL> attrs = super ( MyCustomAtom1Feed , self ) . root_attributes ( ) <EOL> attrs [ u'<STR_LIT>' ] = u'<STR_LIT>' <EOL> return attrs <EOL> def add_root_elements ( self , handler ) : <EOL> super ( MyCustomAtom1Feed , self ) . add_root_elements ( handler ) <EOL> handler . addQuickElement ( u'<STR_LIT>' , u'<STR_LIT>' ) <EOL> def item_attributes ( self , item ) : <EOL> attrs = super ( MyCustomAtom1Feed , self ) . item_attributes ( item ) <EOL> attrs [ u'<STR_LIT>' ] = u'<STR_LIT>' <EOL> return attrs <EOL> def add_item_elements ( self , handler , item ) : <EOL> super ( MyCustomAtom1Feed , self ) . add_item_elements ( handler , item ) <EOL> handler . addQuickElement ( u'<STR_LIT>' , u'<STR_LIT>' ) <EOL> class TestCustomFeed ( TestAtomFeed ) : <EOL> feed_type = MyCustomAtom1Feed </s>
