diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-07-13 21:20:07 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-07-13 21:20:07 +0000 |
| commit | 9fa91e0ab3656055d882a1a063abfec6fdd85eae (patch) | |
| tree | 3cbb49094203a06398a2ac4474660a8d6ec194cc /docs/newforms.txt | |
| parent | 193e6db4577adef8ac5654c73a633b69ed823f1b (diff) | |
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
Diffstat (limited to 'docs/newforms.txt')
| -rw-r--r-- | docs/newforms.txt | 7 |
1 files changed, 7 insertions, 0 deletions
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
