Source

django-blog / feeds.py

Full commit
# -*- coding: utf-8 -*-
from django.utils.feedgenerator import Atom1Feed
from django.contrib.syndication.views import Feed

from cedricbonhomme.blog.models import Post

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

    def items(self):
        return Post.objects.order_by('-created')[:15]

    def item_description(self, item):
        return item.content_html

    def item_link(self, item):
        return self.link + str(item.id)

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