django-model-utils icon indicating copy to clipboard operation
django-model-utils copied to clipboard

InheritanceManager doesn't work with Proxy Model

Open chhantyal opened this issue 9 years ago • 9 comments

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>]

chhantyal avatar May 05 '15 10:05 chhantyal