diff options
| author | Simon Charette <charette.s@gmail.com> | 2013-02-11 02:39:14 -0500 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2013-02-11 02:39:14 -0500 |
| commit | a10f3908042a71ec5ef81bf76f0f278ca5e7a596 (patch) | |
| tree | 879bf91f6b9e6419b06ebc9b0bd6b739a7b99105 /docs | |
| parent | 5ce6a7cea25ac8e616fa6bd132ee341a240aad6f (diff) | |
Fixed #19044 -- Made `DeletionMixin` interpolate its `success_url`.
Thanks to nxvl and slurms for the initial patch, ptone for the review
and timo for the documentation tweaks.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/class-based-views/mixins-editing.txt | 7 | ||||
| -rw-r--r-- | docs/releases/1.6.txt | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt index bce3c84cb1..844171c93a 100644 --- a/docs/ref/class-based-views/mixins-editing.txt +++ b/docs/ref/class-based-views/mixins-editing.txt @@ -201,6 +201,13 @@ ProcessFormView The url to redirect to when the nominated object has been successfully deleted. + .. versionadded:: 1.6 + + ``success_url`` may contain dictionary string formatting, which + will be interpolated against the object's field attributes. For + example, you could use ``success_url="/parent/%(parent_id)s/"`` to + redirect to a URL composed out of the ``parent_id`` field on a model. + .. method:: get_success_url(obj) Returns the url to redirect to when the nominated object has been diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt index f53fa8ac4c..5d615177f4 100644 --- a/docs/releases/1.6.txt +++ b/docs/releases/1.6.txt @@ -64,6 +64,10 @@ Minor features :attr:`~django.core.management.BaseCommand.leave_locale_alone` internal option. See :ref:`management-commands-and-locales` for more details. +* The :attr:`~django.views.generic.edit.DeletionMixin.success_url` of + :class:`~django.views.generic.edit.DeletionMixin` is now interpolated with + its ``object``\'s ``__dict__``. + Backwards incompatible changes in 1.6 ===================================== |
