summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-15 18:03:00 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-15 18:03:00 +0000
commit7969c1bb655d24f98e8653d9008c90c6b0280673 (patch)
treea9508b3be6a3cb37c63e240d4c78c1aa9155d00e /docs
parenta10e73ac3029de6fffef451594232499f4087cd2 (diff)
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
Diffstat (limited to 'docs')
-rw-r--r--docs/model-api.txt9
-rw-r--r--docs/syndication_feeds.txt5
2 files changed, 13 insertions, 1 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 961269aebd..e7afbfd13a 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/syndication_feeds.txt b/docs/syndication_feeds.txt
index d9d4f53b88..2a03e6d5a6 100644
--- a/docs/syndication_feeds.txt
+++ b/docs/syndication_feeds.txt
@@ -146,7 +146,10 @@ put into those elements.
exist, it tries calling a method ``item_link()`` in the ``Feed`` class,
passing it a single parameter, ``item``, which is the object itself.
Both ``get_absolute_url()`` and ``item_link()`` should return the item's
- URL as a normal Python string.
+ URL as a normal Python string. As with ``get_absolute_url()``, the
+ result of ``item_link()`` will be included directly in the URL, so you
+ are responsible for doing all necessary URL quoting and conversion to
+ ASCII inside the method itself.
* For the LatestEntries example above, we could have very simple feed templates: