Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #5327 -- Added standardized field information to ModelChoiceFie…

…ld and ModelMultipleChoiceField documentation. Thanks to danielrubio for the report and PhiR for the text.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8d36476 commit 767cf955d25d0ab82e6b9bd4b6360a1ccef15706 Gabriel Hurley committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 docs/ref/forms/fields.txt
14 docs/ref/forms/fields.txt
@@ -856,6 +856,12 @@ objects (in the case of ``ModelMultipleChoiceField``) into the
.. class:: ModelChoiceField(**kwargs)
+ * Default widget: ``Select``
+ * Empty value: ``None``
+ * Normalizes to: A model instance.
+ * Validates that the given id exists in the queryset.
+ * Error message keys: ``required``, ``invalid_choice``
Allows the selection of a single model object, suitable for
representing a foreign key. A single argument is required:
@@ -901,6 +907,14 @@ example::
.. class:: ModelMultipleChoiceField(**kwargs)
+ * Default widget: ``SelectMultiple``
+ * Empty value: ``[]`` (an empty list)
+ * Normalizes to: A list of model instances.
+ * Validates that every id in the given list of values exists in the
+ queryset.
+ * Error message keys: ``required``, ``list``, ``invalid_choice``,
+ ``invalid_pk_value``
Allows the selection of one or more model objects, suitable for
representing a many-to-many relation. As with :class:`ModelChoiceField`,
you can use ``label_from_instance`` to customize the object

0 comments on commit 767cf95

Please sign in to comment.
Something went wrong with that request. Please try again.