Manager not inherited in model inheritance
|Reported by:||Alex Robbins||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.1|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a base model that defines some published fields and has a manager that knows how to use them. When other models inherit from it, they get the fields. However, they don't get the manager. (It is intentionally left out http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L73)
I know I can just set the manager explicitly on every child model, but that is the sort of thing I was hoping to avoid by using inheritance.
The knowledgeable jdunck explained that a new manager instance has to be made since managers know what model they are for, and the child models need a different manager instance than the parent. It isn't as simple as removing line 77 in the above code.
Still it'd be nice...