Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@adrianholovaty adrianholovaty authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 docs/newforms.txt
View
7 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please sign in to comment.
Something went wrong with that request. Please try again.