fopina / django-bulk-update-or-create

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

ValueError: no objects to update_or_create... #10

Closed rtubio closed 3 years ago

rtubio commented 3 years ago

I am now seeing the following exception when executing the bulk_update_or_create function, if there are no objects to be written to the database:

raise ValueError('no objects to update_or_create...')
ValueError: no objects to update_or_create...

Although this is easily fixable by just checking that the array to be passed to the function is not empty, the behavior is different to that from the standard update_or_create from Django's ORM.

Is there any reason why this is kept this way? In my opinion, it is different from the expectations of those used to work with Django.

fopina commented 3 years ago

done! thanks for the feedback @rtubio 👍