Skip to content

Commit

Permalink
[2.2.x] Fixed #30395 -- Doc'd a limitation of ModelForm.Meta.widgets.
Browse files Browse the repository at this point in the history
Backport of a309821 from master
  • Loading branch information
rixx authored and felixxm committed May 17, 2019
1 parent 4ef96cc commit 85b6984
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/topics/forms/modelforms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 85b6984

Please sign in to comment.