diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2013-11-07 12:30:04 +0100 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2013-11-08 10:55:11 +0100 |
| commit | 6c34e18bd41237328b50177411809bd800fcab21 (patch) | |
| tree | b25f88f05956ea63514b4672ba3f4240897c3c9a /docs/ref | |
| parent | 6026a5091b4973366c008f5439bfd496d50f5fa4 (diff) | |
[1.6.x] Fixed #21396: Document backwards-incompatible change in RedirectView.get_redirect_url.
Thanks to Tim for the review.
Backport of f2e0266be766b0b6149377b90ae3ddc41c91c3fb from master.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/class-based-views/base.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt index da4c66280e..06a2e8dd44 100644 --- a/docs/ref/class-based-views/base.txt +++ b/docs/ref/class-based-views/base.txt @@ -239,12 +239,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. |
