Django

Code

Changeset 5691

Show
Ignore:
Timestamp:
07/13/07 16:20:07 (1 year ago)
Author:
adrian
Message:

Documented the 'commit' argument to save() methods on forms created via form_for_model() or form_for_instance()

Files:

Legend:

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

    r5609 r5691  
    14961496doesn't validate -- i.e., ``if form.errors``. 
    14971497 
     1498This ``save()`` method accepts an optional ``commit`` keyword argument, which 
     1499accepts either ``True`` or ``False``. If you call ``save()`` with 
     1500``commit=False``, then it will return an object that hasn't yet been saved to 
     1501the database. In this case, it's up to you to call ``save()`` on the resulting 
     1502model instance. This is useful if you want to do custom processing on the 
     1503object before saving it. ``commit`` is ``True`` by default. 
     1504 
    14981505Using an alternate base class 
    14991506~~~~~~~~~~~~~~~~~~~~~~~~~~~~~