-
Is there an equivalent of I have multiple concurrent requests happening - in each request I only want to update one particular field - but because update() saves the whole model, its possible that there will be race conditions and one request will accidentally overwrite the changes of a previous request, even though they are updating different fields each. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yeah, it's a clear omission. And in 0.10.2 (PR #140) that will be merged this week I added |
Beta Was this translation helpful? Give feedback.
-
@aliakhtar Aaaaaand, it's out ;) |
Beta Was this translation helpful? Give feedback.
Yeah, it's a clear omission.
In
bulk_update
you havecolumns: List
to set columns that should be updated.In
QuerySet.update
(soModel.objects.update(**kwargs)
) you only update params passed askwargs
.And in 0.10.2 (PR #140) that will be merged this week I added
_columns: List[str]
toModel.update()
where you can pass fields that should be updated (if omitted or empty all fields are updated)