Changeset 1195
- Timestamp:
- 11/11/05 21:48:14 (3 years ago)
- Files:
-
- django/trunk/docs/syndication_feeds.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/syndication_feeds.txt
r1194 r1195 125 125 specified in the URLconf for the given feed. The RSS system renders that 126 126 template for each item, passing it two template context variables: 127 * ``{{ obj }}`` -- The current object (one of whichever objects you 128 returned in ``items()``). 129 * ``{{ site }}`` -- A ``django.models.core.sites.Site`` object 130 representing the current site. This is useful for 131 ``{{ site.domain }}`` or ``{{ site.name }}``. 127 128 * ``{{ obj }}`` -- The current object (one of whichever objects you 129 returned in ``items()``). 130 * ``{{ site }}`` -- A ``django.models.core.sites.Site`` object 131 representing the current site. This is useful for 132 ``{{ site.domain }}`` or ``{{ site.name }}``. 133 132 134 If you don't create a template for either the title or description, the 133 135 framework will use the template ``{{ obj }}`` by default -- that is, the … … 211 213 each of ``title``, ``link`` and ``description``, Django follows this 212 214 algorithm: 213 * First, it tries to call a method, passing the ``obj`` argument, where 214 ``obj`` is the object returned by ``get_object()``. 215 * Failing that, it tries to call a method with no arguments. 216 * Failing that, it uses the class attribute. 215 216 * First, it tries to call a method, passing the ``obj`` argument, where 217 ``obj`` is the object returned by ``get_object()``. 218 * Failing that, it tries to call a method with no arguments. 219 * Failing that, it uses the class attribute. 220 217 221 * Finally, note that ``items()`` in this example also takes the ``obj`` 218 222 argument. The algorithm for ``items`` is the same as described in the … … 305 309 306 310 Feed class reference 307 ------------------- 311 -------------------- 308 312 309 313 This example illustrates all possible attributes and methods for a ``Feed`` class:: … … 497 501 498 502 ``__init__(title, link, description, language=None, author_email=None, 499 author_name=None, author_link=None, subtitle=None, categories=None)``503 author_name=None, author_link=None, subtitle=None, categories=None)`` 500 504 501 505 Initializes the feed with the given metadata, which applies to the entire feed … … 506 510 507 511 ``add_item(title, link, description, author_email=None, author_name=None, 508 pubdate=None, comments=None, unique_id=None, enclosure=None, categories=())``512 pubdate=None, comments=None, unique_id=None, enclosure=None, categories=())`` 509 513 510 514 Add an item to the feed with the given parameters. All parameters, if given,
