Fixed #30395 -- Doc'd a limitation of ModelForm.Meta.widgets.

This commit is contained in:
Tobias Kunze 2019-04-27 17:49:14 +02:00 committed by Mariusz Felisiak
parent 1686dce06c
commit a309821c97
1 changed files with 3 additions and 1 deletions

View File

@ -522,7 +522,9 @@ For example, if you want the ``CharField`` for the ``name`` attribute of
}
The ``widgets`` dictionary accepts either widget instances (e.g.,
``Textarea(...)``) or classes (e.g., ``Textarea``).
``Textarea(...)``) or classes (e.g., ``Textarea``). Note that the ``widgets``
dictionary is ignored for a model field with a non-empty ``choices`` attribute.
In this case, you must override the form field to use a different widget.
Similarly, you can specify the ``labels``, ``help_texts`` and ``error_messages``
attributes of the inner ``Meta`` class if you want to further customize a field.