fopina / django-bulk-update-or-create

`bulk_update_or_create` for Django model managers
MIT License
148 stars 16 forks source link

`update only fields` document? #31

Open fopinappb opened 2 years ago

fopinappb commented 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.

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)