#18094: `pre_delete` and `post_delete` signals are not correctly sent in inheritance scenarios involving proxy models -------------------------------------+------------------------------------- Reporter: charettes | Owner: charettes Type: Bug | Status: assigned Component: Database layer | Version: 1.4 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Keywords: model proxy multi- | Unreviewed table inheritance signals delete | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): Making init signals consistent isn't likely for performance reasons - in fact it might make sense to replace them with init hooks. That would fit the use case of the signals, and currently the init signals can make model init around 2x slower in the not so uncommon case that model init signals are defined for some __other__ model in the project - not necessarily the one being initialized. Altering save signals to fire for each parent class (proxy or not) would make sense. Assuming Foo and !FooBar(Foo) models, it is more than likely that if you have a signal for Foo that then you have attached the same signal for !FooBar too. Because you want to catch "Foo saved" when !FooBar is saved - the exact issue we are trying to fix here. So, fixing the signals in the way suggested in this ticket removes the need of attaching the same signal multiple times but at same time __is__ going to break existing usage. For how many users is a different question. I am not sure if the above backwards compatibility issue is meaningful for delete signals, so if consistency is not possible then fixing just delete signals makes sense. All in all, maybe the consistency issue should be discussed at django- developers? -- Ticket URL: <https://code.djangoproject.com/ticket/18094#comment:8> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.