I want to generate a feed of latest entries of a blog post under a particular tag. I used django-tagging. How can i do this? Here is how i defined my LatestEntriesFeed
from django.core.exceptions import ObjectDoesNotExist
from django.utils.feedgenerator import Atom1Feed
from django.contrib.sites.models import Site
from django.contrib.syndication.feeds import Feed
from articles.models import Entry
current_site = Site.objects.get_current()
class LatestEntriesFeed(Feed):
title = 'Latest Entries for %s' % current_site
link = '/feeds/latest/'
description = 'Latest entries posted.'
def items(self):
return Entry.live.all()[:100]
def item_pubdate(self, item):
return item.pub_date
def item_guid(self, item):
return "tag:%s,%s:%s" % (current_site.domain,
item.pub_date.strftime('%Y-%m-%d'),
item.get_absolute_url())