Open fopinappb opened 2 years ago
As update_fields is passed to bulk_update but ignored when falling back to .create, all the values from the object are used when creating.
update_fields
bulk_update
.create
This is actually documented in update_fields docs:
:param update_fields: fields that will be updated if record already exists (passed on to bulk_update)
but it's only implicit that .create will use object as passed, regardless of chosen fields, better to document the behavior (as it's a useful feature)
.create will use object as passed, regardless of chosen fields
As
update_fields
is passed tobulk_update
but ignored when falling back to.create
, all the values from the object are used when creating.This is actually documented in
update_fields
docs:but it's only implicit that
.create will use object as passed, regardless of chosen fields
, better to document the behavior (as it's a useful feature)