diff options
| author | Gabriel Muñumel <gabrielmunumel@gmail.com> | 2014-08-06 22:26:23 -0430 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-15 08:14:45 -0400 |
| commit | deed00c0d803d324a3dfdeba52458b6b009c1a90 (patch) | |
| tree | 3026981d579f569d4c7bcdf1855a8b32dff98e57 /docs | |
| parent | 99561eef26b75947891929a2b7d5b2c605aa2456 (diff) | |
Fixed #23162 -- Renamed forms.Field._has_changed() to has_changed().
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 3 | ||||
| -rw-r--r-- | docs/ref/forms/api.txt | 4 | ||||
| -rw-r--r-- | docs/ref/forms/fields.txt | 18 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 6 |
4 files changed, 30 insertions, 1 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index ee5e9d0f67..ed84626d3f 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -46,6 +46,9 @@ about each item can often be found in the release notes of two versions prior. * Support for string ``view`` arguments to ``url()`` will be removed. +* The backward compatible shim to rename ``django.forms.Form._has_changed()`` + to ``has_changed()`` will be removed. + .. _deprecation-removed-in-1.9: 1.9 diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index da8e8a92f1..deb974ad5d 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -279,7 +279,9 @@ so that the comparison can be done: >>> f.has_changed() ``has_changed()`` will be ``True`` if the data from ``request.POST`` differs -from what was provided in :attr:`~Form.initial` or ``False`` otherwise. +from what was provided in :attr:`~Form.initial` or ``False`` otherwise. The +result is computed by calling :meth:`Field.has_changed` for each field in the +form. Accessing the fields from the form ---------------------------------- diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 3fbbac9624..1d8a1c9b5d 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -299,6 +299,24 @@ as the rendered output. See the :ref:`format localization <format-localization>` documentation for more information. + +Checking if the field data has changed +-------------------------------------- + +``has_changed()`` +~~~~~~~~~~~~~~~~~~ + +.. method:: Field.has_changed() + +.. versionchanged:: 1.8 + + This method was renamed from ``_has_changed()``. + +The ``has_changed()`` method is used to determine if the field value has changed +from the initial value. Returns ``True`` or ``False``. + +See the :class:`Form.has_changed()` documentation for more information. + .. _built-in-fields: Built-in ``Field`` classes diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index ae8c1e4d91..9b013c676c 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -676,3 +676,9 @@ An older (pre-1.0), more restrictive and verbose input format for the Using the new syntax, this becomes:: ``['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]`` + +``django.forms.Field._has_changed()`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Rename this method to :meth:`~django.forms.Field.has_changed` by removing the +leading underscore. The old name will still work until Django 2.0. |
