Reputation: 4963
I understand that both models.Model
and forms.ModelForm
both contain .save()
method that you can override. My question is how and when are they used to save an object and in what sequence.
Upvotes: 2
Views: 59
Reputation: 20559
ModelForm.save()
is called first and it is calling Model.save()
internally.
Method in ModelForm
is an helper to build or update Model
object from data provided in form and save it to database. It also saves any many to many or reversed foreign key relations.
Upvotes: 2