Browse files

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

…ia form_for_model() or form_for_instance()

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 193e6db commit 9fa91e0ab3656055d882a1a063abfec6fdd85eae @adrianholovaty adrianholovaty committed Jul 13, 2007
Showing with 7 additions and 0 deletions.
  1. +7 −0 docs/newforms.txt
@@ -1495,6 +1495,13 @@ example::
Note that ``save()`` will raise a ``ValueError`` if the data in the form
doesn't validate -- i.e., ``if form.errors``.
+This ``save()`` method accepts an optional ``commit`` keyword argument, which
+accepts either ``True`` or ``False``. If you call ``save()`` with
+``commit=False``, then it will return an object that hasn't yet been saved to
+the database. In this case, it's up to you to call ``save()`` on the resulting
+model instance. This is useful if you want to do custom processing on the
+object before saving it. ``commit`` is ``True`` by default.
Using an alternate base class

0 comments on commit 9fa91e0

Please sign in to comment.