Django

Code

Changeset 4031

Show
Ignore:
Timestamp:
11/06/06 19:54:34 (2 years ago)
Author:
jacob
Message:

Fixed #2987: cleaned up the syndication documentation a bit, thanks to dev@simon.net.nz.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/syndication_feeds.txt

    r3721 r4031  
    9696    from chicagocrime.models import NewsItem 
    9797 
    98     class SiteNewsFeed(Feed): 
     98    class LatestEntries(Feed): 
    9999        title = "Chicagocrime.org site news" 
    100100        link = "/sitenews/" 
     
    121121 
    122122    * 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`` 
    125125      specified in the URLconf for the given feed. Note the ``.html`` extension 
    126126      is required. The RSS system renders that template for each item, passing 
     
    128128 
    129129          * ``{{ obj }}`` -- The current object (one of whichever objects you 
    130             returned in ``items()``). 
     130            returned in ``items()``).  
    131131          * ``{{ site }}`` -- A ``django.models.core.sites.Site`` object 
    132132            representing the current site. This is useful for 
     
    145145      Both ``get_absolute_url()`` and ``item_link()`` should return the item's 
    146146      URL as a normal Python string. 
     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 }} 
    147157 
    148158.. _chicagocrime.org: http://www.chicagocrime.org/