diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/class-based-views/mixins-editing.txt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt index 3dcf28dae3..0bfbcbd3f7 100644 --- a/docs/ref/class-based-views/mixins-editing.txt +++ b/docs/ref/class-based-views/mixins-editing.txt @@ -160,9 +160,15 @@ ModelFormMixin ``success_url`` may contain dictionary string formatting, which will be interpolated against the object's field attributes. For - example, you could use ``success_url="/polls/%(slug)s/"`` to + example, you could use ``success_url="/polls/{slug}/"`` to redirect to a URL composed out of the ``slug`` field on a model. + .. versionchanged:: 1.8 + + Support for the new brace-based Python formatting syntax has been + added. The old ``%(slug)s`` placeholder syntax support has been + deprecated and will be removed in Django 2.0. + .. method:: get_form_class() Retrieve the form class to instantiate. If @@ -248,9 +254,15 @@ DeletionMixin ``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 + could use ``success_url="/parent/{parent_id}/"`` to redirect to a URL composed out of the ``parent_id`` field on a model. + .. versionchanged:: 1.8 + + Support for the new brace-based Python formatting syntax has been + added. The old ``%(slug)s`` placeholder syntax support has been + deprecated and will be removed in Django 2.0. + .. method:: get_success_url() Returns the url to redirect to when the nominated object has been |
