summaryrefslogtreecommitdiff
path: root/docs/syndication_feeds.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/syndication_feeds.txt')
-rw-r--r--docs/syndication_feeds.txt18
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/syndication_feeds.txt b/docs/syndication_feeds.txt
index 225b67eb02..59a9022d9b 100644
--- a/docs/syndication_feeds.txt
+++ b/docs/syndication_feeds.txt
@@ -95,7 +95,7 @@ latest five news items::
from django.contrib.syndication.feeds import Feed
from chicagocrime.models import NewsItem
- class SiteNewsFeed(Feed):
+ class LatestEntries(Feed):
title = "Chicagocrime.org site news"
link = "/sitenews/"
description = "Updates on changes and additions to chicagocrime.org."
@@ -120,14 +120,14 @@ One thing's left to do. In an RSS feed, each ``<item>`` has a ``<title>``,
put into those elements.
* To specify the contents of ``<title>`` and ``<description>``, create
- `Django templates`_ called ``feeds/sitenews_title.html`` and
- ``feeds/sitenews_description.html``, where ``sitenews`` is the ``slug``
+ `Django templates`_ called ``feeds/latest_title.html`` and
+ ``feeds/latest_description.html``, where ``latest`` is the ``slug``
specified in the URLconf for the given feed. Note the ``.html`` extension
is required. The RSS system renders that template for each item, passing
it two template context variables:
* ``{{ obj }}`` -- The current object (one of whichever objects you
- returned in ``items()``).
+ returned in ``items()``).
* ``{{ site }}`` -- A ``django.models.core.sites.Site`` object
representing the current site. This is useful for
``{{ site.domain }}`` or ``{{ site.name }}``.
@@ -145,6 +145,16 @@ put into those elements.
Both ``get_absolute_url()`` and ``item_link()`` should return the item's
URL as a normal Python string.
+ * For the LatestEntries example above, we could have very simple feed templates:
+
+ * latest_title.html::
+
+ {{ obj.title }}
+
+ * latest_description.html::
+
+ {{ obj.description }}
+
.. _chicagocrime.org: http://www.chicagocrime.org/
.. _object-relational mapper: http://www.djangoproject.com/documentation/db_api/
.. _Django templates: http://www.djangoproject.com/documentation/templates/