Answer the question
In order to leave comments, you need to log in
Custom manager to update all model objects with a specific field?
The user model has a field counters , it is by default = 0. When doing various manipulations, it is incremented. So I need to reset this field to 0 for all users at a certain time. If you do this through a regular manager, then it looks like this:
query = User.objects.all()
query.update(counters = 0)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question