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.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-05-15 18:03:00 +00:00
parent a10e73ac30
commit 7969c1bb65
2 changed files with 13 additions and 1 deletions

View file

@ -1759,6 +1759,15 @@ But this template code is good::
<a href="{{ object.get_absolute_url }}">{{ object.name }}</a>
.. note::
The string you return from ``get_absolute_url()`` must be use only ASCII
characters (required by the URI spec, `RFC 2396`_) that has been
URL-encoded, if necessary. Code and templates using ``get_absolute_url()``
should be able to use the result directly without needing to do any
further processing.
.. _RFC 2396: http://www.ietf.org/rfc/rfc2396.txt
The ``permalink`` decorator
~~~~~~~~~~~~~~~~~~~~~~~~~~~