user8106849
user8106849

Reputation: 60

Efficient way to update multiple model instances

I want to update multiple attributes of multiple model instances of same model. It should update the instance based on the primary key.

Upvotes: 0

Views: 169

Answers (1)

Derüs Mantilla
Derüs Mantilla

Reputation: 31

Maybe the best solution for that porpuse is using update function from django.

ModelName.objects.all().update(**new_data)

Upvotes: 1

Related Questions