Skip to content

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

@craigds

Description

@craigds
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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions