Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Documented the 'commit' argument to save() methods on forms created v…

…ia form_for_model() or form_for_instance()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9fa91e0ab3656055d882a1a063abfec6fdd85eae 1 parent 193e6db
Adrian Holovaty authored July 13, 2007

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

  1. 7  docs/newforms.txt
7  docs/newforms.txt
@@ -1495,6 +1495,13 @@ example::
1495 1495
 Note that ``save()`` will raise a ``ValueError`` if the data in the form
1496 1496
 doesn't validate -- i.e., ``if form.errors``.
1497 1497
 
  1498
+This ``save()`` method accepts an optional ``commit`` keyword argument, which
  1499
+accepts 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
  1501
+the database. In this case, it's up to you to call ``save()`` on the resulting
  1502
+model instance. This is useful if you want to do custom processing on the
  1503
+object before saving it. ``commit`` is ``True`` by default.
  1504
+
1498 1505
 Using an alternate base class
1499 1506
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1500 1507
 

0 notes on commit 9fa91e0

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