Skip to content

Commit ebbc414

Browse files
committed
Fixed django#16168 - Added note regarding type requirements when overridng ModelForm fields.
Thanks Pieter Swinkels for the patch.
1 parent 964979e commit ebbc414

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/topics/forms/modelforms.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ parameter when declaring the form field::
437437
class Meta:
438438
model = Article
439439

440+
You must ensure that the type of the form field can be used to set the
441+
contents of the corresponding model field. When they are not compatible,
442+
you will get a ``ValueError`` as no implicit conversion takes place.
443+
440444
See the :doc:`form field documentation </ref/forms/fields>` for more information
441445
on fields and their arguments.
442446

0 commit comments

Comments
 (0)