Django

Code

Changeset 5250

Show
Ignore:
Timestamp:
05/15/07 13:03:00 (1 year ago)
Author:
mtredinnick
Message:

Fixed #3664 -- Documented that get_absolute_url() and item_link() (in
syndication) links are expected to be strings that can be used in URLs without
further quoting or encoding.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/model-api.txt

    r5166 r5250  
    17601760    <a href="{{ object.get_absolute_url }}">{{ object.name }}</a> 
    17611761 
     1762.. note:: 
     1763    The string you return from ``get_absolute_url()`` must be use only ASCII 
     1764    characters (required by the URI spec, `RFC 2396`_) that has been 
     1765    URL-encoded, if necessary. Code and templates using ``get_absolute_url()`` 
     1766    should be able to use the result directly without needing to do any 
     1767    further processing. 
     1768 
     1769.. _RFC 2396: http://www.ietf.org/rfc/rfc2396.txt 
     1770 
    17621771The ``permalink`` decorator 
    17631772~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  • django/trunk/docs/syndication_feeds.txt

    r5139 r5250  
    147147      passing it a single parameter, ``item``, which is the object itself. 
    148148      Both ``get_absolute_url()`` and ``item_link()`` should return the item's 
    149       URL as a normal Python string. 
     149      URL as a normal Python string. As with ``get_absolute_url()``, the 
     150      result of ``item_link()`` will be included directly in the URL, so you 
     151      are responsible for doing all necessary URL quoting and conversion to 
     152      ASCII inside the method itself. 
    150153 
    151154    * For the LatestEntries example above, we could have very simple feed templates: