Fixed ReST bugs in docs/syndication_feeds.txt

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-11-12 03:48:14 +00:00
parent 944de9e9e6
commit 10214bdac0
1 changed files with 16 additions and 12 deletions

View File

@ -124,11 +124,13 @@ put into those elements.
``feeds/sitenews_description``, where ``sitenews`` is the ``slug``
specified in the URLconf for the given feed. 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()``).
* ``{{ site }}`` -- A ``django.models.core.sites.Site`` object
representing the current site. This is useful for
``{{ site.domain }}`` or ``{{ site.name }}``.
If you don't create a template for either the title or description, the
framework will use the template ``{{ obj }}`` by default -- that is, the
normal string representation of the object.
@ -210,10 +212,12 @@ request to the URL ``/rss/beats/0613/``:
example illustrates that they can be either strings *or* methods. For
each of ``title``, ``link`` and ``description``, Django follows this
algorithm:
* First, it tries to call a method, passing the ``obj`` argument, where
``obj`` is the object returned by ``get_object()``.
* Failing that, it tries to call a method with no arguments.
* Failing that, it uses the class attribute.
* Finally, note that ``items()`` in this example also takes the ``obj``
argument. The algorithm for ``items`` is the same as described in the
previous step -- first, it tries ``items(obj)``, then ``items()``, then
@ -304,7 +308,7 @@ And the accompanying URLconf::
)
Feed class reference
-------------------
--------------------
This example illustrates all possible attributes and methods for a ``Feed`` class::