django-model-utils
django-model-utils copied to clipboard
InheritanceManager doesn't work with Proxy Model
I created an app to demonstrate this bug here https://github.com/chhantyal/mptt-test
Please see the models here https://github.com/chhantyal/mptt-test/blob/master/mptt_test/app/models.py
When I use select_subclasses()
, it doesn't give subclass object but superclass object (in this case ProxyPage object itself).
In [1]: from mptt_test.app.models import Blog, PageProxy
In [2]: Blog.objects.create(title='Title', quote='blog')
Out[2]: <Blog: Blog object>
In [3]: PageProxy.objects.all().select_subclasses()
Out[3]: [<PageProxy: PageProxy object>]