Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signals on parent class don't propagate to child classes #1

Open
craigds opened this issue May 16, 2012 · 0 comments
Open

Signals on parent class don't propagate to child classes #1

craigds opened this issue May 16, 2012 · 0 comments

Comments

@craigds
Copy link
Owner

craigds commented May 16, 2012

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant