1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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

Thanks to Tim for the review.
This commit is contained in:
Baptiste Mispelon
2013-11-07 12:30:04 +01:00
parent 536c447820
commit f2e0266be7
2 changed files with 20 additions and 3 deletions

View File

@@ -233,12 +233,23 @@ RedirectView
**Methods**
.. method:: get_redirect_url(**kwargs)
.. method:: get_redirect_url(*args, **kwargs)
Constructs the target URL for redirection.
.. versionchanged:: 1.6
The signature of this method was changed to include ``*args``.
The default implementation uses :attr:`url` as a starting
string, performs expansion of ``%`` parameters in that string, as well
as the appending of query string if requested by :attr:`query_string`.
string and performs expansion of ``%`` named parameters in that string
using the named groups captured in the URL.
If :attr:`url` is not set, ``get_redirect_url()`` tries to reverse the
:attr:`pattern_name` using what was captured in the URL (both named and
unnamed groups are used).
If requested by :attr:`query_string`, it will also append the query
string to the generated URL.
Subclasses may implement any behavior they wish, as long as the method
returns a redirect-ready URL string.