diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-01-12 12:00:27 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-01-12 22:51:22 +0100 |
| commit | f48e2258a96a08dcec843921206bcf7656e3ae45 (patch) | |
| tree | ee6c9a0afae7ceeb053d7cf2d76a4b50c9f3545b /docs/ref | |
| parent | 5f7230e12f0d237cdc19d8930006b0fc7d9dbaa6 (diff) | |
Fixed #24133 -- Replaced formatting syntax in success_url placeholders
Thanks Laurent Payot for the report, and Markus Holtermann, Tim Graham
for the reviews.
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 |
