Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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: http://code.djangoproject.com/svn/django/trunk@14214 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 767cf955d25d0ab82e6b9bd4b6360a1ccef15706 1 parent 8d36476
authored October 14, 2010

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 767cf95

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