~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to news/feeds.py

  • Committer: Holger Rapp
  • Date: 2010-01-01 21:35:23 UTC
  • mto: (173.3.2 widelands)
  • mto: This revision was merged to the branch mainline in revision 176.
  • Revision ID: rapp@mrt.uka.de-20100101213523-53rcapbemm69ep6u
Made the site compatible to django 1.1 and all the various packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
 
9
9
class NewsPostsFeed(Feed):
 
10
    _site = Site.objects.get_current()
10
11
    title = 'Widelands news posts feed'
11
12
    description = 'The news section from the widelands.org homepage'
12
 
    title_template = 'feeds/posts_title.html'
13
 
    description_template = 'feeds/posts_description.html'
14
13
 
15
14
    def link(self):
16
15
        return reverse('news_index')
23
22
 
24
23
 
25
24
class NewsPostsByCategory(Feed):
26
 
    title = 'Widelands.org posts category feed'
27
 
 
 
25
    _site = Site.objects.get_current()
 
26
    title = '%s posts category feed' % _site.name
 
27
    
28
28
    def get_object(self, bits):
29
29
        if len(bits) != 1:
30
30
            raise ObjectDoesNotExist
37
37
 
38
38
    def description(self, obj):
39
39
        return "Posts recently categorized as %s" % obj.title
40
 
 
 
40
    
41
41
    def items(self, obj):
42
42
        return obj.post_set.published()[:10]