<s> """<STR_LIT>""" <EOL> from django . utils . feedgenerator import Rss201rev2Feed <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . core . exceptions import ObjectDoesNotExist <EOL> from django . core . urlresolvers import reverse <EOL> from django . contrib . syndication import feeds <EOL> from django . contrib . sites . models import Site <EOL> from website . apps . blog . models import Entry <EOL> from website . apps . blog . models import Category <EOL> class RssEntries ( feeds . Feed ) : <EOL> """<STR_LIT>""" <EOL> feed_type = Rss201rev2Feed <EOL> title_template = "<STR_LIT>" <EOL> description_template = "<STR_LIT>" <EOL> def title ( self ) : <EOL> """<STR_LIT>""" <EOL> site = Site . objects . get_current ( ) <EOL> return _ ( '<STR_LIT>' ) % { <EOL> '<STR_LIT>' : site . name , <EOL> } <EOL> def description ( self ) : <EOL> """<STR_LIT>""" <EOL> site = Site . objects . get_current ( ) <EOL> return _ ( '<STR_LIT>' ) % { <EOL> '<STR_LIT>' : site . name , <EOL> } <EOL> def link ( self ) : <EOL> """<STR_LIT>""" <EOL> return reverse ( '<STR_LIT>' ) <EOL> def items ( self ) : <EOL> """<STR_LIT>""" <EOL> return Entry . online_objects . order_by ( '<STR_LIT>' ) [ : <NUM_LIT:10> ] <EOL> def item_pubdate ( self , item ) : <EOL> """<STR_LIT>""" <EOL> return item . publication_date <EOL> class RssCategory ( RssEntries ) : <EOL> """<STR_LIT>""" <EOL> def title ( self , obj ) : <EOL> """<STR_LIT>""" <EOL> site = Site . objects . get_current ( ) <EOL> return _ ( '<STR_LIT>' ) % { <EOL> '<STR_LIT>' : site . name , <EOL> '<STR_LIT>' : obj . name , <EOL> } <EOL> def description ( self , obj ) : <EOL> """<STR_LIT>""" <EOL> site = Site . objects . get_current ( ) <EOL> return _ ( '<STR_LIT>' ) % { <EOL> '<STR_LIT>' : obj . name , <EOL> '<STR_LIT>' : site . name , <EOL> } <EOL> def link ( self , obj ) : <EOL> """<STR_LIT>""" <EOL> return reverse ( '<STR_LIT>' , args = [ obj . slug ] ) <EOL> def get_object ( self , bits ) : <EOL> """<STR_LIT>""" <EOL> if len ( bits ) != <NUM_LIT:1> : <EOL> raise ObjectDoesNotExist <EOL> return Category . online_objects . get ( slug = bits [ <NUM_LIT:0> ] ) <EOL> def items ( self , obj ) : <EOL> """<STR_LIT>""" <EOL> return obj . online_entry_set <EOL> def item_pubdate ( self , item ) : <EOL> """<STR_LIT>""" <EOL> return item . publication_date </s>
