Opened 12 years ago
Closed 12 years ago
#22236 closed Cleanup/optimization (fixed)
Gratuitous and inappropriate use of signals
| Reported by: | Aymeric Augustin | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (1)
Change History (5)
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|---|
| Type: | Bug → Cleanup/optimization |
by , 12 years ago
| Attachment: | 22236-1.diff added |
|---|
comment:2 by , 12 years ago
| Has patch: | set |
|---|
comment:3 by , 12 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:4 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 0a65da941c1643f0ce8d2c9644b12d3f07319c6d: