Re: Multitable inheritance - reverse relation

2010-05-27 Thread bohemian
I haven't think about it this way. It works (using "a_ptr__b"). Thank you for help Scott! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send em

Re: Multitable inheritance - reverse relation

2010-05-27 Thread Scott Gould
Try: myB = B.objects.get(pk=1) myCs = C.objects.filter(a__b=myB) Regards Scott > I have model A in which there is field ForeignKey(B). I also have > model C which inherits from model A. None of these models is abstract. > Having B object, can I find all C objects pointing to it? When I use > som

Multitable inheritance - reverse relation

2010-05-27 Thread bohemian
Hello! I have model A in which there is field ForeignKey(B). I also have model C which inherits from model A. None of these models is abstract. Having B object, can I find all C objects pointing to it? When I use something like this: Bobject.C_set.all() there appears an error: 'AttributeError: B o