1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Fixed #29549 -- Doc'd that Field.choices are enforced by model validation.

This commit is contained in:
Tim Graham 2018-07-09 15:06:36 -04:00 committed by GitHub
parent 45c035c823
commit 8b1d361f28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,8 +82,9 @@ If a field has ``blank=False``, the field will be required.
An iterable (e.g., a list or tuple) consisting itself of iterables of exactly
two items (e.g. ``[(A, B), (A, B) ...]``) to use as choices for this field. If
this is given, the default form widget will be a select box with these choices
instead of the standard text field.
choices are given, they're enforced by :ref:`model validation
<validating-objects>` and the default form widget will be a select box with
these choices instead of the standard text field.
The first element in each tuple is the actual value to be set on the model,
and the second element is the human-readable name. For example::