Django

Code

Changeset 7298

Show
Ignore:
Timestamp:
03/18/08 13:20:45 (8 months ago)
Author:
ubernostrum
Message:

Fixed #6120: First stab at documenting newforms field types which handle relationships.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/newforms.txt

    r7294 r7298  
    15001500~~~~~~~~~~~~~~~~~~~~~~ 
    15011501 
     1502Fields which handle relationships 
     1503--------------------------------- 
     1504 
     1505For representing relationships between models, two fields are 
     1506provided which can derive their choices from a ``QuerySet``, and which 
     1507place one or more model objects into the ``cleaned_data`` dictionary 
     1508of forms in which they're used. Both of these fields have an 
     1509additional 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 
     1519Allows the selection of a single model object, suitable for 
     1520representing a foreign key. 
     1521 
     1522``ModelMultipleChoiceField`` 
     1523~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     1524 
     1525Allows the selection of one or more model objects, suitable for 
     1526representing a many-to-many relation. 
     1527 
     1528 
    15021529Creating custom fields 
    15031530----------------------