<s> from django . contrib . syndication . views import FeedDoesNotExist , Feed <EOL> import models <EOL> class LatestEntries ( Feed ) : <EOL> def get_object ( self , bits ) : <EOL> if len ( bits ) != <NUM_LIT:0> : <EOL> raise models . Topic . DoesNotExist <EOL> return '<STR_LIT>' <EOL> title = '<STR_LIT>' <EOL> link = '<STR_LIT:/>' <EOL> description = '<STR_LIT>' <EOL> def items ( self , obj ) : <EOL> return models . Link . objects . all ( ) . order_by ( '<STR_LIT>' ) [ : <NUM_LIT:30> ] <EOL> class LatestEntriesByTopic ( Feed ) : <EOL> def get_object ( self , bits ) : <EOL> if len ( bits ) != <NUM_LIT:1> : <EOL> raise models . Topic . DoesNotExist <EOL> return models . Topic . objects . get ( name__exact = bits [ <NUM_LIT:0> ] ) <EOL> def title ( self , obj ) : <EOL> return "<STR_LIT>" % obj . name <EOL> def link ( self , obj ) : <EOL> if not obj : <EOL> raise FeedDoesNotExist <EOL> return obj . get_absolute_url ( ) <EOL> def description ( self , obj ) : <EOL> return obj . full_name <EOL> def items ( self , obj ) : <EOL> return models . Link . objects . filter ( topic = obj ) . order_by ( '<STR_LIT>' ) [ : <NUM_LIT:30> ] </s>
