Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Clean up some awkwardness and confusion in the docs for ``ModelChoice…

…Field``

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7386 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b8110ed537408ef78027f70c242885c7a955e1bb 1 parent a9ce132
James Bennett authored March 30, 2008

Showing 1 changed file with 12 additions and 8 deletions. Show diff stats Hide diff stats

  1. 20  docs/newforms.txt
20  docs/newforms.txt
@@ -1549,12 +1549,15 @@ additional required argument:
1549 1549
 ``ModelChoiceField``
1550 1550
 ~~~~~~~~~~~~~~~~~~~~
1551 1551
 
1552  
-Allows the selection of a single model object, suitable for representing a
1553  
-foreign key. The method receives an object as an argument and must return a
1554  
-string to represent it.
  1552
+Allows the selection of a single model object, suitable for
  1553
+representing a foreign key.
1555 1554
 
1556  
-The labels for the choice field call the ``__unicode__`` method of the model to
1557  
-generate string representations. To provide custom labels, subclass ``ModelChoiceField`` and override ``label_for_model``::
  1555
+The labels for the choice field call the ``__unicode__`` method of the
  1556
+model to generate string representations to use in the field's
  1557
+choices; to provide customized representations,, subclass
  1558
+``ModelChoiceField`` and override ``label_for_model``; this method
  1559
+will receive an object, and should return a string suitable for
  1560
+representing it::
1558 1561
 
1559 1562
     class MyModelChoiceField(ModelChoiceField):
1560 1563
         def label_from_instance(self, obj):
@@ -1563,9 +1566,10 @@ generate string representations. To provide custom labels, subclass ``ModelChoic
1563 1566
 ``ModelMultipleChoiceField``
1564 1567
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1565 1568
 
1566  
-Allows the selection of one or more model objects, suitable for representing a
1567  
-many-to-many relation. As with ``ModelChoiceField``, you can use
1568  
-``label_from_instance`` to customize the object labels.
  1569
+Allows the selection of one or more model objects, suitable for
  1570
+representing a many-to-many relation. As with ``ModelChoiceField``,
  1571
+you can use ``label_from_instance`` to customize the object
  1572
+representations.
1569 1573
 
1570 1574
 Creating custom fields
1571 1575
 ----------------------

0 notes on commit b8110ed

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