__init__ of Models not overrideable
|Reported by:||Armin Ronacher||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Apparently django is calling
__init__ for models created from database data. This makes it impossible to override the constructor that has a different signature.
It would make more sense if the database API is creating a verbatim instance of the class using
object.__new__(Model) and updating the attributes. It would also be possible to add a
construct method that is called when a model is assembled from database data.
I can provide a patch if wanted.