Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #15593 -- Added a note that the output of `reverse` is urlquote…

…d. Thanks to guettli for the report and draft patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1b1060c9168227e9ff4b1e9141ba6086134030bd 1 parent 6bdaef2
authored April 20, 2011
2  docs/ref/unicode.txt
@@ -140,6 +140,8 @@ Normally, you'll only need to use ``smart_unicode()``. Call it as early as
140 140
 possible on any input data that might be either Unicode or a bytestring, and
141 141
 from then on, you can treat the result as always being Unicode.
142 142
 
  143
+.. _uri-and-iri-handling:
  144
+
143 145
 URI and IRI handling
144 146
 ~~~~~~~~~~~~~~~~~~~~
145 147
 
16  docs/topics/http/urls.txt
@@ -772,9 +772,9 @@ reverse()
772 772
 
773 773
 If you need to use something similar to the :ttag:`url` template tag in
774 774
 your code, Django provides the following method (in the
775  
-``django.core.urlresolvers`` module):
  775
+:mod:`django.core.urlresolvers` module):
776 776
 
777  
-.. function:: reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None)
  777
+.. function:: reverse(viewname, [urlconf=None, args=None, kwargs=None, current_app=None])
778 778
 
779 779
 ``viewname`` is either the function name (either a function reference, or the
780 780
 string version of the name, if you used that form in ``urlpatterns``) or the
@@ -815,6 +815,18 @@ namespaces into URLs on specific application instances, according to the
815 815
     be imported correctly. Do not include lines that reference views you
816 816
     haven't written yet, because those views will not be importable.
817 817
 
  818
+.. note::
  819
+
  820
+    The string returned by :meth:`~django.core.urlresolvers.reverse` is already
  821
+    :ref:`urlquoted <uri-and-iri-handling>`. For example::
  822
+
  823
+        >>> reverse('cities', args=u'Orléans')
  824
+        '.../Orl%C3%A9ans/'
  825
+
  826
+    Applying further encoding (such as :meth:`~django.utils.http.urlquote` or
  827
+    ``urllib.quote``) to the ouput of :meth:`~django.core.urlresolvers.reverse`
  828
+    may produce undesirable results.
  829
+
818 830
 resolve()
819 831
 ---------
820 832
 

0 notes on commit 1b1060c

Please sign in to comment.
Something went wrong with that request. Please try again.