Gratuitous and inappropriate use of signals
|Reported by:||aaugustin||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Currently, django.db.models.manager contains signals.class_prepared.connect(ensure_default_manager).
But ModelBase._prepare is the only method to send class_prepared. It should simply call ensure_default_manager (and still send the signal for other receivers).
There's no reason for obfuscating control flow with signals.
Change History (5)
comment:1 Changed 12 months ago by mjtamlyn
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Bug to Cleanup/optimization