I am editing a large number of model instances in django and I would like to save all these changes at once.
The instances are already created so I am not looking for bulk_create
. The changes are also different for each instance, so I can't use QuerySet.update(...)
to apply the same change to all of them.
I would like to replace this:
for item in items_to_modify:
item.some_field = process_new_data()
item.save()
by something like:
for item in items_to_modify:
item.some_field = process_new_data()
items_to_modify.save_all_at_once()
I am using django 3.1