summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorGabriel Hurley <gabehr@gmail.com>2010-10-14 10:04:03 +0000
committerGabriel Hurley <gabehr@gmail.com>2010-10-14 10:04:03 +0000
commitece06a80069199acab4569e8a84666114d955535 (patch)
treedf70ac614d579816739171c03611fef4133e91e6 /docs/ref
parente50066d0b59fd106272357f5747d6f4f33b47751 (diff)
[1.2.X] Fixed #5327 -- Added standardized field information to ModelChoiceField and ModelMultipleChoiceField documentation. Thanks to danielrubio for the report and PhiR for the text.
Backport of [14214] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/forms/fields.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 5047d4f5ed..c005436a25 100644
--- a/docs/ref/forms/fields.txt
+++ b/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