django-bulk-update icon indicating copy to clipboard operation
django-bulk-update copied to clipboard

Incorrect work with multi-table inheritance

Open ruscoder opened this issue 10 years ago • 1 comments

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_....

ruscoder avatar Sep 16 '15 08:09 ruscoder

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.

aykut avatar Jan 29 '16 09:01 aykut