About the Custom save() Method of a Model
In Django if you overwrite the save()
method of a model, it will surely be also called by the the manager methods create()
and get_or_create()
, but not by the QuerySet method update()
.
The save()
is called in these cases:
MyModel(title='FIRST').save()
MyModel.objects.create(title='SECOND')
MyModel.objects.get_or_create(title='THIRD')
The save()
is not called in this case:
MyModel.objects.all().update(title='ONE OF ALL')
Tips and Tricks Programming Architecture Django 4.2 Django 3.2 Django 2.2
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.