Suppose I have a Django app backed by Postgres, and in that app I have model called Contact
with a DateTimeField
called last_updated
. Suppose last_updated
has auto_now
set to True
.
I know there are some circumstances in which last_updated
will not get updated when a Contact
record is updated:
Contact.objects.filter(xxx).update(yyy)
will not updatelast_updated
unlesslast_updated
is included inyyy
Contact.objects.bulk_update(contacts_qs, [zzz])
will not updatelast_updated
unlesslast_updated
is inzzz
Are there other ways to update modify Contact
objects (barring accessing the DB directly) where last_updated
won't be updated?