Ticket #19306: 19306.diff

File 19306.diff, 930 bytes (added by Tim Graham, 6 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::
    5555    from django.contrib.syndication.views import Feed
     56    from django.core.urlresolvers import reverse
    5657    from chicagocrime.models import NewsItem
    5859    class LatestEntriesFeed(Feed):
    latest five news items:: 
    6970        def item_description(self, item):
    7071            return item.description
     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])
    7277To connect a URL to this feed, put an instance of the Feed object in
    7378your :doc:`URLconf </topics/http/urls>`. For example::
Back to Top