mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields.
This commit is contained in:
parent
051d5944f8
commit
a2eaea8f22
12 changed files with 48 additions and 19 deletions
|
@ -431,7 +431,7 @@ For each field, we describe the default widget used if you don't specify
|
|||
.. attribute:: choices
|
||||
|
||||
Either an :term:`iterable` of 2-tuples to use as choices for this
|
||||
field, :ref:`enumeration <field-choices-enum-types>` choices, or a
|
||||
field, :ref:`enumeration type <field-choices-enum-types>`, or a
|
||||
callable that returns such an iterable. This argument accepts the same
|
||||
formats as the ``choices`` argument to a model field. See the
|
||||
:ref:`model field reference documentation on choices <field-choices>`
|
||||
|
@ -439,6 +439,11 @@ For each field, we describe the default widget used if you don't specify
|
|||
time the field's form is initialized, in addition to during rendering.
|
||||
Defaults to an empty list.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using :ref:`enumeration types <field-choices-enum-types>`
|
||||
directly in the ``choices`` was added.
|
||||
|
||||
``DateField``
|
||||
-------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue