]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blob - sommitrealweird/blog/feeds.py
Change blog to Blog in the bread crumb
[sommitrealweird.git] / sommitrealweird / blog / feeds.py
1 from django.contrib.syndication.feeds import Feed
2 from django.utils.feedgenerator import Atom1Feed
3 from blog.models import BlogEntry
4 from django.conf import settings
5
6 class LatestBlogEntries(Feed):
7     feed_type = Atom1Feed
8     title = settings.BLOG_TITLE
9     description = u'Updates on %s' %(title,)
10     link = settings.BLOG_ROOT
11
12     title_template = 'blog/feeds/title.html'
13     description_template = 'blog/feeds/description.html'
14
15     def items(self):
16         try:
17             return BlogEntry.objects.all().order_by('-publish_date')[:20]
18         except:
19             return BlogEntry.objects.all().order_by('-publish_date')
20
21     def item_pubdate(self, obj):
22         return obj.publish_date