1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #23681, Fixed #27445 -- Doc'd setting choices for NullBooleanField widgets.

Thanks to David Smith for investigation and review.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
This commit is contained in:
Jacob Walls 2020-10-08 06:39:02 -04:00 committed by GitHub
parent 3d4ffd1ff0
commit d976c254fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -913,6 +913,20 @@ For each field, we describe the default widget used if you don't specify
* Normalizes to: A Python ``True``, ``False`` or ``None`` value.
* Validates nothing (i.e., it never raises a ``ValidationError``).
``NullBooleanField`` may be used with widgets such as
:class:`~django.forms.Select` or :class:`~django.forms.RadioSelect`
by providing the widget ``choices``::
NullBooleanField(
widget=Select(
choices=[
('', 'Unknown'),
(True, 'Yes'),
(False, 'No'),
]
)
)
``RegexField``
--------------