[Answer]-Django 1.7.6 BUG with DateTimeField(auto_now=True) AND .update queries?

1๐Ÿ‘

Realize that update() does an update at the SQL level and, thus, does
not call any save() methods on your models, nor does it emit the
pre_save or post_save signals (which are a consequence of calling
Model.save()). If you want to update a bunch of records for a model
that has a custom save() method, loop over them and call save(), like
this:

for m in YourModel.objects.filter(....):
    m.first_name = "First Name"
    m.save()

You should also know that if you have a customer save method inside you model it will not be called. be in the safe area.

๐Ÿ‘คOthman

Leave a comment