Ticket #19306: 19306.diff

File 19306.diff, 930 bytes (added by Tim Graham, 12 years ago)
  • docs/ref/contrib/syndication.txt

    diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
    index 27b8fc0..2418dba 100644
    a b This simple example, taken from `chicagocrime.org`_, describes a feed of the  
    5353latest five news items::
    5454
    5555    from django.contrib.syndication.views import Feed
     56    from django.core.urlresolvers import reverse
    5657    from chicagocrime.models import NewsItem
    5758
    5859    class LatestEntriesFeed(Feed):
    latest five news items::  
    6970        def item_description(self, item):
    7071            return item.description
    7172
     73        # item_link is only needed if NewsItem has no get_absolute_url method.
     74        def item_link(self, item):
     75            return reverse('news-item', args=[item.pk])
     76
    7277To connect a URL to this feed, put an instance of the Feed object in
    7378your :doc:`URLconf </topics/http/urls>`. For example::
    7479
Back to Top