django-typed-models icon indicating copy to clipboard operation
django-typed-models copied to clipboard

Signals on parent class don't propagate to child classes

Open craigds opened this issue 13 years ago • 0 comments

post_save.connect(func, sender=ParentModel)
...
ChildModel().save()

The signal gets connected to the parent class, and then never gets fired when instances are saved, because they're never saved via the parent model.

This seems craycray. A workaround is to register the signals from all the child classes:

for sender in ParentModel._typedmodels_registry.values():
    post_save.connect(func, sender=sender)

But perhaps we can do better somehow?

craigds avatar May 16 '12 16:05 craigds