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:

1
2
3
MyModel(title='FIRST').save()
MyModel.objects.create(title='SECOND')
MyModel.objects.get_or_create(title='THIRD')

The save() is not called in this case:

1
MyModel.objects.all().update(title='ONE OF ALL')

Tips and Tricks Programming Architecture Django 4.2 Django 3.2 Django 2.2