I have a model MyModel
with a boolean field active
Elsewhere, I am retrieving a queryset:
qs = MyModel.Objects.filter(....)
how can I set active=False
for all objects in this qs
?
You can update all the records in the queryset with
qs.update(active=False)
Please refer to the official Django documentation for more info