Ticket #10376: feeds.diff

File feeds.diff, 1.1 KB (added by RuslanPopov, 16 years ago)

Patch for syndication's feeds.py

  • django/contrib/syndication/feeds.py

     
    3030        self.slug = slug
    3131        self.request = request
    3232        self.feed_url = request.path
    33         self.title_template_name = self.title_template or ('feeds/%s_title.html' % slug)
    34         self.description_template_name = self.description_template or ('feeds/%s_description.html' % slug)
     33        self.appname = request.path.split('/')[1] # get app name from url
     34        if self.appname:
     35            self.title_template_name = self.title_template or \
     36              ('%s/feeds/%s_title.html' % (self.appname, slug))
     37            self.description_template_name = self.description_template or \
     38              ('%s/feeds/%s_description.html' % (self.appname, slug))
     39        else:
     40            self.title_template_name = self.title_template or ('feeds/%s_title.html' % slug)
     41            self.description_template_name = self.description_template or ('feeds/%s_description.html' % slug)
    3542
    3643    def item_link(self, item):
    3744        try:
Back to Top