aykut / django-bulk-update

Bulk update using one query over Django ORM
MIT License
432 stars 59 forks source link

Incorrect work with multi-table inheritance #32

Open ruscoder opened 9 years ago

ruscoder commented 9 years ago

Hello. I've caught a problem with multi-table inheritance (for example see https://docs.djangoproject.com/en/1.8/topics/db/models/#multi-table-inheritance) When I tried to invoke bulk_update(Restaurant.objects.all()) I got exceptions such as:

column "name" of relation "app_restaurant" does not exist
LINE 1: UPDATE "app_restaurant" SET "name" = CAST(CASE "place_....
aykut commented 8 years ago

Hi, We could achieve this by making two different SQL updates. Currently, we can update the fields on Restaurant by looking the local_fields on meta but it won't update the fields like name on Place. So it could cause problems.

It would be a cool feature to have.

Thanks.