Open NotSqrt opened 10 years ago
Hi,
I'm a bit surprised to see this issue. Projects that I run on polymorphic completely depend on the fact that ModelB won't return instances of other types. That's in fact standard behavior.
Do you have a test case to prove that is not the case? Could there be an overwritten Manager sitting in your models somewhere?
yeah, you're probably right, I will check my intermediate managers..
I have similar problem (in my case I only get ModelA
), but your solution of creating manager InstanceOfPolymorphicManager
does not works for me, so I finally find this way, it is not a queryset but a list but it solved my problem: ModelA.objects.get_real_instances()
Hi !
When you have models like:
It would be nice to be able to do:
without the addition of
instance_of
everytime.I have a simple solution, and am looking for comments/other ways to do this: