Opened 16 years ago
Closed 16 years ago
#11653 closed (wontfix)
Manager not inherited in model inheritance
Description ¶
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...
This works as documented: Custom managers and model inheritance. Marking as wontfix, if you disagree please take this to the django-developers mailing list.