Opened 9 years ago

Closed 7 years ago

#21175 closed Bug (wontfix)

abstract base model classes never fire class_prepared signal

Reported by: Carl Meyer Owned by: Christopher Babiak
Component: Database layer (models, ORM) Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


I can't think of a reason why this would be the preferred behavior.

In fact, ensure_default_managers (which is one of two uses of class_prepared in Django itself) is written with a specific case to handle abstract classes, even though it will never receive one, so clearly somebody else had an expectation that they would fire the signal too.

Change History (5)

comment:1 Changed 9 years ago by Daniele Procida

Triage Stage: UnreviewedAccepted

comment:2 Changed 9 years ago by Christopher Babiak

Owner: changed from nobody to Christopher Babiak
Status: newassigned

comment:3 Changed 9 years ago by Christopher Babiak

comment:4 Changed 8 years ago by Tim Graham

Has patch: set
Patch needs improvement: set

Left some comments for improvement on the PR. Please uncheck "Patch needs improvement" if you can update it, thanks.

comment:5 Changed 7 years ago by Carl Meyer

Resolution: wontfix
Status: assignedclosed

I am closing this; in light of #24313 and discussion on #24215, I no longer think it makes sense for abstract models to fire class_prepared. (In fact I'm hopeful that we can get rid of class_prepared altogether, making it moot.)

Note: See TracTickets for help on using tickets.
Back to Top