Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2987: cleaned up the syndication documentation a bit, thanks t…

…o dev@simon.net.nz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 09d40c508a54e79dc324f62410fac7f34526a1f7 1 parent 644af22
Jacob Kaplan-Moss authored November 07, 2006

Showing 1 changed file with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. 18  docs/syndication_feeds.txt
18  docs/syndication_feeds.txt
@@ -95,7 +95,7 @@ latest five news items::
95 95
     from django.contrib.syndication.feeds import Feed
96 96
     from chicagocrime.models import NewsItem
97 97
 
98  
-    class SiteNewsFeed(Feed):
  98
+    class LatestEntries(Feed):
99 99
         title = "Chicagocrime.org site news"
100 100
         link = "/sitenews/"
101 101
         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>``,
120 120
 put into those elements.
121 121
 
122 122
     * To specify the contents of ``<title>`` and ``<description>``, create
123  
-      `Django templates`_ called ``feeds/sitenews_title.html`` and
124  
-      ``feeds/sitenews_description.html``, where ``sitenews`` is the ``slug``
  123
+      `Django templates`_ called ``feeds/latest_title.html`` and
  124
+      ``feeds/latest_description.html``, where ``latest`` is the ``slug``
125 125
       specified in the URLconf for the given feed. Note the ``.html`` extension
126 126
       is required. The RSS system renders that template for each item, passing
127 127
       it two template context variables:
128 128
 
129 129
           * ``{{ obj }}`` -- The current object (one of whichever objects you
130  
-            returned in ``items()``).
  130
+            returned in ``items()``). 
131 131
           * ``{{ site }}`` -- A ``django.models.core.sites.Site`` object
132 132
             representing the current site. This is useful for
133 133
             ``{{ site.domain }}`` or ``{{ site.name }}``.
@@ -145,6 +145,16 @@ put into those elements.
145 145
       Both ``get_absolute_url()`` and ``item_link()`` should return the item's
146 146
       URL as a normal Python string.
147 147
 
  148
+    * For the LatestEntries example above, we could have very simple feed templates:
  149
+
  150
+          * latest_title.html::
  151
+
  152
+             {{ obj.title }}
  153
+
  154
+          * latest_description.html::
  155
+
  156
+             {{ obj.description }}
  157
+
148 158
 .. _chicagocrime.org: http://www.chicagocrime.org/
149 159
 .. _object-relational mapper: http://www.djangoproject.com/documentation/db_api/
150 160
 .. _Django templates: http://www.djangoproject.com/documentation/templates/

0 notes on commit 09d40c5

Please sign in to comment.
Something went wrong with that request. Please try again.