Allow model signal sender to be specified lazily
|Reported by:||charettes||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
With the introduction of the swappable User model there is no sane way for a third party application to connect signals to it.
Hence I propose to make the Signal.connect method of model signals (pre|post_init, pre|post_save, pre|post_delete, m2m_changed) accept a model name ('app_label.ModelName') as its sender argument.
This should allow third party application to connect signals to the swappable user model by referring to it using settings.AUTH_USER_MODEL and is consistent with the suggest way of referring to it as the target of related fields.
Will be attaching a POC with missing documentation.
Change History (8)
comment:3 Changed 5 months ago by charettes
- Needs documentation unset
- Patch needs improvement unset