http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method
When using commit=False
, you have to call save_m2m()
m2m relationships require the parent object to be saved first, which you are not doing by using commit=False
More Related Contents:
- Django Forms: if not valid, show form with error message
- Issue with ManyToMany Relationships not updating immediately after save
- Django form field choices, adding an attribute
- Applying bootstrap styles to django forms
- Django ModelChoiceField: filtering query set and setting default value as an object
- Django: How do I add arbitrary html attributes to input fields on a form?
- Create Custom Error Messages with Model Forms
- Django/jQuery Cascading Select Boxes?
- Why does django’s prefetch_related() only work with all() and not filter()?
- Select DISTINCT individual columns in django?
- Initial populating on Django Forms
- Django multi-select widget?
- How to rename items in values() in Django?
- Django form with choices but also with freetext option?
- Chaining multiple filter() in Django, is this a bug?
- Django – Overriding the Model.create() method?
- List field in model?
- Django templates: verbose version of a choice
- Django unique_together with nullable ForeignKey
- Default image for ImageField in Django’s ORM
- Django: ManyToMany filter matching on ALL items in a list
- Django, ModelChoiceField() and initial value
- Django Forms: pass parameter to form
- How to use custom manager with related objects?
- ModelForm with OneToOneField in Django
- How to limit file types on file uploads for ModelForms with FileFields?
- Django: access the parent instance from the Inline model admin
- Creating Partial Indexes with Django 1.7
- Django – forms.FileField() initial value
- Get type of Django form widget from within template