Consider the following definitions:
class A(models.Model):
...
class B(models.Model):
a_obs = models.ForeignKey(A, related_name='b')
class C(models.Model):
b_obs = models.ForeignKey(B, related_name='c')
let's say we have an instance ob1
of type A
. How could I do a double reverse lookup in order to obtain all C
instances related to ob1
without using the C.objects
nor the B.objects
managers?
Normally doing ob1.b.all()
will give me a QuerySet
of B
's, but what then?