Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #5327 -- Added standardized field information to ModelC…

…hoiceField 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
  • Loading branch information...
commit ece06a80069199acab4569e8a84666114d955535 1 parent e50066d
authored

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  docs/ref/forms/fields.txt
14  docs/ref/forms/fields.txt
@@ -856,6 +856,12 @@ objects (in the case of ``ModelMultipleChoiceField``) into the
856 856
 
857 857
 .. class:: ModelChoiceField(**kwargs)
858 858
 
  859
+    * Default widget: ``Select``
  860
+    * Empty value: ``None``
  861
+    * Normalizes to: A model instance.
  862
+    * Validates that the given id exists in the queryset.
  863
+    * Error message keys: ``required``, ``invalid_choice``
  864
+
859 865
 Allows the selection of a single model object, suitable for
860 866
 representing a foreign key.  A single argument is required:
861 867
 
@@ -901,6 +907,14 @@ example::
901 907
 
902 908
 .. class:: ModelMultipleChoiceField(**kwargs)
903 909
 
  910
+    * Default widget: ``SelectMultiple``
  911
+    * Empty value: ``[]`` (an empty list) 
  912
+    * Normalizes to: A list of model instances.
  913
+    * Validates that every id in the given list of values exists in the
  914
+      queryset.
  915
+    * Error message keys: ``required``, ``list``, ``invalid_choice``, 
  916
+      ``invalid_pk_value``
  917
+
904 918
 Allows the selection of one or more model objects, suitable for
905 919
 representing a many-to-many relation. As with :class:`ModelChoiceField`,
906 920
 you can use ``label_from_instance`` to customize the object

0 notes on commit ece06a8

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