diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index ca9e4d868f..a8d2fa77ff 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -767,6 +767,8 @@ method you're using::

Sender:

Cc myself:

+.. _ref-forms-error-list-format: + Customizing the error list format ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -792,10 +794,10 @@ Python 2)::

Cc myself:

More granular output -~~~~~~~~~~~~~~~~~~~~ +-------------------- -The ``as_p()``, ``as_ul()`` and ``as_table()`` methods are simply shortcuts for -lazy developers -- they're not the only way a form object can be displayed. +The ``as_p()``, ``as_ul()``, and ``as_table()`` methods are simply shortcuts -- +they're not the only way a form object can be displayed. .. class:: BoundField @@ -830,107 +832,180 @@ The field-specific output honors the form object's ``auto_id`` setting:: >>> print(f['message']) -For a field's list of errors, access the field's ``errors`` attribute. +Attributes of ``BoundField`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. attribute:: BoundField.data + + This property returns the data for this :class:`~django.forms.BoundField` + extracted by the widget's :meth:`~django.forms.Widget.value_from_datadict` + method, or ``None`` if it wasn't given:: + + >>> unbound_form = ContactForm() + >>> print(unbound_form['subject'].data) + None + >>> bound_form = ContactForm(data={'subject': 'My Subject'}) + >>> print(bound_form['subject'].data) + My Subject .. attribute:: BoundField.errors -A list-like object that is displayed as an HTML ``