Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-taggit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
00699f48
authored
Aug 20, 2010
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document using commit=False on forms.
parent
274d1304
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
docs/forms.txt
+16
-0
No files found.
docs/forms.txt
View file @
00699f48
...
@@ -33,3 +33,19 @@ apple "ball cat" dog ``["apple", "ball cat", "dog"]`` No commas, so space del
...
@@ -33,3 +33,19 @@ apple "ball cat" dog ``["apple", "ball cat", "dog"]`` No commas, so space del
"apple" "ball dog ``["apple", "ball", "dog"]`` Unclosed double quote is ignored
"apple" "ball dog ``["apple", "ball", "dog"]`` Unclosed double quote is ignored
====================== ================================= ================================================
====================== ================================= ================================================
``commit=False``
~~~~~~~~~~~~~~~~
If, when saving a form you use the ``commit=False`` option you'll need to call
``save_m2m()`` on the form after you save the object, just as you would for a
form with normal many to many fields on it::
if request.method == "POST":
form = MyFormClass(requets.POST)
if form.is_valid():
obj = form.save(commit=False)
obj.user = request.user
obj.save()
# Without this next line the tags won't be saved.
form.save_m2m()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment