From 9fa91e0ab3656055d882a1a063abfec6fdd85eae Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 13 Jul 2007 21:20:07 +0000 Subject: [PATCH] Documented the 'commit' argument to save() methods on forms created via form_for_model() or form_for_instance() git-svn-id: http://code.djangoproject.com/svn/django/trunk@5691 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/newforms.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/newforms.txt b/docs/newforms.txt index c2e08c63b9..a51317343f 100644 --- a/docs/newforms.txt +++ b/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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~