From deed00c0d803d324a3dfdeba52458b6b009c1a90 Mon Sep 17 00:00:00 2001 From: Gabriel Muñumel Date: Wed, 6 Aug 2014 22:26:23 -0430 Subject: Fixed #23162 -- Renamed forms.Field._has_changed() to has_changed(). --- docs/ref/forms/api.txt | 4 +++- docs/ref/forms/fields.txt | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'docs/ref/forms') 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 ` 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 -- cgit v1.3