Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #6120: First stab at documenting newforms field types which han…

…dle relationships.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 75617ef69f7b0fa491ce1d3cb5d4a8d478203ad1 1 parent a752a3d
James Bennett authored March 18, 2008

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

  1. 27  docs/newforms.txt
27  docs/newforms.txt
@@ -1499,6 +1499,33 @@ the bottom of this document, for examples of their use.
1499 1499
 ``SplitDateTimeField``
1500 1500
 ~~~~~~~~~~~~~~~~~~~~~~
1501 1501
 
  1502
+Fields which handle relationships
  1503
+---------------------------------
  1504
+
  1505
+For representing relationships between models, two fields are
  1506
+provided which can derive their choices from a ``QuerySet``, and which
  1507
+place one or more model objects into the ``cleaned_data`` dictionary
  1508
+of forms in which they're used. Both of these fields have an
  1509
+additional required argument:
  1510
+
  1511
+``queryset``
  1512
+    A ``QuerySet`` of model objects from which the choices for the
  1513
+    field will be derived, and which will be used to validate the
  1514
+    user's selection.
  1515
+
  1516
+``ModelChoiceField``
  1517
+~~~~~~~~~~~~~~~~~~~~
  1518
+
  1519
+Allows the selection of a single model object, suitable for
  1520
+representing a foreign key.
  1521
+
  1522
+``ModelMultipleChoiceField``
  1523
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1524
+
  1525
+Allows the selection of one or more model objects, suitable for
  1526
+representing a many-to-many relation.
  1527
+
  1528
+
1502 1529
 Creating custom fields
1503 1530
 ----------------------
1504 1531
 

0 notes on commit 75617ef

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