For cases like where @depend_on_related('myapp.MultiTableModel', foreign_key='some') is used in a multi-table inheritance setting, when the foreign key field some is actually in the parent model of MultiTableModel, the trigger to set the dirty flag are, nonetheless, created as:
INSERT INTO denorm_dirtyinstance (content_type_id,object_id) VALUES(75,some_id);
When they should be instead created as:
INSERT INTO denorm_dirtyinstance (content_type_id,object_id) (SELECT DISTINCT 75, some_id FROM myapp_multitableparentmodel WHERE id = NEW.multitableparentmodel_ptr_id);
For cases like where
@depend_on_related('myapp.MultiTableModel', foreign_key='some')
is used in a multi-table inheritance setting, when the foreign key fieldsome
is actually in the parent model ofMultiTableModel
, the trigger to set the dirty flag are, nonetheless, created as:When they should be instead created as:
I added a gist with a patch to fix this: https://gist.github.com/Kronuz/5091384