Source

armonge.info / blog / feeds.py

# -*- coding: utf-8 -*-

from django.contrib.syndication.views import Feed
from blog.models import Post
from django.utils.feedgenerator import Atom1Feed

class RssSiteNewsFeed(Feed):
    title = "armonge"
    link = "/blog/"
    description = "Updates on changes and additions to chicagocrime.org."

    def items(self):
        return Post.published.all().order_by('-date_published')[:5]

class AtomSiteNewsFeed(RssSiteNewsFeed):
    feed_type = Atom1Feed
    subtitle = RssSiteNewsFeed.description