Browse files

[1.5.X] Fixed #19306 - Improved syndication example.

Thanks brycenesbitt for the report.

Backport of 1f1f60d from master
  • Loading branch information...
1 parent eb67a45 commit 17c61aaea303a5f21537d9978c28135f6f17b489 @timgraham timgraham committed Nov 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 docs/ref/contrib/syndication.txt
@@ -53,6 +53,7 @@ This simple example, taken from ``_, describes a feed of the
latest five news items::
from django.contrib.syndication.views import Feed
+ from django.core.urlresolvers import reverse
from chicagocrime.models import NewsItem
class LatestEntriesFeed(Feed):
@@ -69,6 +70,10 @@ latest five news items::
def item_description(self, item):
return item.description
+ # item_link is only needed if NewsItem has no get_absolute_url method.
+ def item_link(self, item):
+ return reverse('news-item', args=[])
To connect a URL to this feed, put an instance of the Feed object in
your :doc:`URLconf </topics/http/urls>`. For example::

0 comments on commit 17c61aa

Please sign in to comment.