Do Django Models inherit managers? (Mine seem not to)
Posted
by Zach
on Stack Overflow
See other posts from Stack Overflow
or by Zach
Published on 2010-03-16T19:16:43Z
Indexed on
2010/03/16
19:21 UTC
Read the original article
Hit count: 281
I have 2 models:
class A(Model):
#Some Fields
objects = ClassAManager()
class B(A):
#Some B-specific fields
I would expect B.objects
to give me access to an instance of ClassAManager
, but this is not the case....
>>> A.objects
<app.managers.ClassAManager object at 0x103f8f290>
>>> B.objects
<django.db.models.manager.Manager object at 0x103f94790>
Why doesn't B
inherit the objects
attribute from A
?
© Stack Overflow or respective owner