Django

Code

Changeset 4263

Show
Ignore:
Timestamp:
12/30/06 00:14:39 (2 years ago)
Author:
adrian
Message:

Updated docstring in model_forms unit test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/modeltests/model_forms/models.py

    r4261 r4263  
    2234. Generating HTML forms from models 
    33 
    4 Django provides shortcuts for creating Form objects from a model class. 
     4Django provides shortcuts for creating Form objects from a model class and a 
     5model instance. 
    56 
    67The function django.newforms.form_for_model() takes a model class and returns 
     
    1011the database if create(save=True), which is default. If you pass 
    1112create(save=False), then you'll get the object without saving it. 
     13 
     14The function django.newforms.form_for_instance() takes a model instance and 
     15returns a Form that is tied to the instance. This form works just like any 
     16other Form, with one additional method: apply_changes(). The apply_changes() 
     17method updates the model instance. It saves the changes to the database if 
     18apply_changes(save=True), which is default. If you pass save=False, then you'll 
     19get the object without saving it. 
    1220""" 
    1321