Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #21396: Document backwards-incompatible change in RedirectView.…

…get_redirect_url.

Thanks to Tim for the review.
  • Loading branch information...
commit f2e0266be766b0b6149377b90ae3ddc41c91c3fb 1 parent 536c447
Baptiste Mispelon authored November 07, 2013
17  docs/ref/class-based-views/base.txt
@@ -233,12 +233,23 @@ RedirectView
233 233
 
234 234
     **Methods**
235 235
 
236  
-    .. method:: get_redirect_url(**kwargs)
  236
+    .. method:: get_redirect_url(*args, **kwargs)
237 237
 
238 238
         Constructs the target URL for redirection.
239 239
 
  240
+        .. versionchanged:: 1.6
  241
+
  242
+            The signature of this method was changed to include ``*args``.
  243
+
240 244
         The default implementation uses :attr:`url` as a starting
241  
-        string, performs expansion of ``%`` parameters in that string, as well
242  
-        as the appending of query string if requested by :attr:`query_string`.
  245
+        string and performs expansion of ``%`` named parameters in that string
  246
+        using the named groups captured in the URL.
  247
+
  248
+        If :attr:`url` is not set, ``get_redirect_url()`` tries to reverse the
  249
+        :attr:`pattern_name` using what was captured in the URL (both named and
  250
+        unnamed groups are used).
  251
+
  252
+        If requested by :attr:`query_string`, it will also append the query
  253
+        string to the generated URL.
243 254
         Subclasses may implement any behavior they wish, as long as the method
244 255
         returns a redirect-ready URL string.
6  docs/releases/1.6.txt
@@ -913,6 +913,12 @@ Miscellaneous
913 913
   been removed. Use ``socket.error`` provided by the standard library instead.
914 914
   This change was also released in Django 1.5.5.
915 915
 
  916
+* The signature of :meth:`django.views.generic.base.RedirectView.get_redirect_url`
  917
+  has changed and now accepts positional arguments as well (``*args, **kwargs``).
  918
+  Any unnamed captured group will now be passed to ``get_redirect_url()``
  919
+  which may result in a ``TypeError`` if you don't update the signature of your
  920
+  custom method.
  921
+
916 922
 Features deprecated in 1.6
917 923
 ==========================
918 924
 

0 notes on commit f2e0266

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