Fixed #11374 -- Modified the documentation for forms.BooleanField to allow for the fact that it can be rendered using widgets other than a checkbox. Thanks to lygaret for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11236 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e114cbf3de
commit
75514ab7bc
|
@ -275,7 +275,7 @@ For each field, we describe the default widget used if you don't specify
|
||||||
* Default widget: ``CheckboxInput``
|
* Default widget: ``CheckboxInput``
|
||||||
* Empty value: ``False``
|
* Empty value: ``False``
|
||||||
* Normalizes to: A Python ``True`` or ``False`` value.
|
* Normalizes to: A Python ``True`` or ``False`` value.
|
||||||
* Validates that the check box is checked (i.e. the value is ``True``) if
|
* Validates that the value is ``True`` (e.g. the check box is checked) if
|
||||||
the field has ``required=True``.
|
the field has ``required=True``.
|
||||||
* Error message keys: ``required``
|
* Error message keys: ``required``
|
||||||
|
|
||||||
|
@ -287,9 +287,10 @@ For each field, we describe the default widget used if you don't specify
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Since all ``Field`` subclasses have ``required=True`` by default, the
|
Since all ``Field`` subclasses have ``required=True`` by default, the
|
||||||
validation condition here is important. If you want to include a checkbox
|
validation condition here is important. If you want to include a boolean
|
||||||
in your form that can be either checked or unchecked, you must remember to
|
in your form that can be either ``True`` or ``False`` (e.g. a checked or
|
||||||
pass in ``required=False`` when creating the ``BooleanField``.
|
unchecked checkbox), you must remember to pass in ``required=False`` when
|
||||||
|
creating the ``BooleanField``.
|
||||||
|
|
||||||
``CharField``
|
``CharField``
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Reference in New Issue