[Django]-How to update a field without change auto-now field?

4👍

If you have a Client object, you can specify the fields to update with the update_fields=… parameter of the .save(…) method [Django-doc] of your model:

c1 = …  # (some client)
c1.joined = True
c1.save(update_fields=['joined'])

If you want to update Clients with a single query (or in bulk), you can work with .update(…) [Django-doc]:

c1 = Client.objects.filter(pk=some_pk).update(
    joined=True
)

1👍

DateTime field is updated when .save() method is called, you can update needed field(s) using .update method.

Leave a comment