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
6 class LatestBlogEntriesRss(Feed):
7 title = settings.BLOG_TITLE
8 description = u'Updates on %s' %(title,)
9 link = settings.BLOG_ROOT
11 title_template = 'blog/feeds/title.html'
12 description_template = 'blog/feeds/description.html'
16 return BlogEntry.objects.filter(islive=True).order_by('-publish_date')[:20]
18 return BlogEntry.objects.filter(islive=True).order_by('-publish_date')
20 def author_name(self, obj):
23 def author_email(self, obj):
24 return "iDunno@sommitrealweird.co.uk"
26 def item_author_name(self, obj):
29 def item_author_email(self, obj):
30 return "iDunno@sommitrealweird.co.uk"
32 def item_pubdate(self, obj):
33 return obj.publish_date
35 class LatestBlogEntries(LatestBlogEntriesRss):
37 subtitle = LatestBlogEntriesRss.description