Author: gabrielhurley
Date: 2011-04-20 12:51:54 -0700 (Wed, 20 Apr 2011)
New Revision: 16055

Modified:
   django/branches/releases/1.3.X/docs/ref/unicode.txt
   django/branches/releases/1.3.X/docs/topics/http/urls.txt
Log:
[1.3.X] Fixed #15593 -- Added a note that the output of `reverse` is urlquoted. 
Thanks to guettli for the report and draft patch.

Backport of [16054] from trunk.


Modified: django/branches/releases/1.3.X/docs/ref/unicode.txt
===================================================================
--- django/branches/releases/1.3.X/docs/ref/unicode.txt 2011-04-20 19:50:27 UTC 
(rev 16054)
+++ django/branches/releases/1.3.X/docs/ref/unicode.txt 2011-04-20 19:51:54 UTC 
(rev 16055)
@@ -140,6 +140,8 @@
 possible on any input data that might be either Unicode or a bytestring, and
 from then on, you can treat the result as always being Unicode.
 
+.. _uri-and-iri-handling:
+
 URI and IRI handling
 ~~~~~~~~~~~~~~~~~~~~
 

Modified: django/branches/releases/1.3.X/docs/topics/http/urls.txt
===================================================================
--- django/branches/releases/1.3.X/docs/topics/http/urls.txt    2011-04-20 
19:50:27 UTC (rev 16054)
+++ django/branches/releases/1.3.X/docs/topics/http/urls.txt    2011-04-20 
19:51:54 UTC (rev 16055)
@@ -772,9 +772,9 @@
 
 If you need to use something similar to the :ttag:`url` template tag in
 your code, Django provides the following method (in the
-``django.core.urlresolvers`` module):
+:mod:`django.core.urlresolvers` module):
 
-.. function:: reverse(viewname, urlconf=None, args=None, kwargs=None, 
current_app=None)
+.. function:: reverse(viewname, [urlconf=None, args=None, kwargs=None, 
current_app=None])
 
 ``viewname`` is either the function name (either a function reference, or the
 string version of the name, if you used that form in ``urlpatterns``) or the
@@ -815,6 +815,18 @@
     be imported correctly. Do not include lines that reference views you
     haven't written yet, because those views will not be importable.
 
+.. note::
+
+    The string returned by :meth:`~django.core.urlresolvers.reverse` is already
+    :ref:`urlquoted <uri-and-iri-handling>`. For example::
+
+        >>> reverse('cities', args=u'Orléans')
+        '.../Orl%C3%A9ans/'
+
+    Applying further encoding (such as :meth:`~django.utils.http.urlquote` or
+    ``urllib.quote``) to the ouput of :meth:`~django.core.urlresolvers.reverse`
+    may produce undesirable results.
+
 resolve()
 ---------
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to