title: django: more complicated filter
body: <p>I have these models:</p>
  
  <p>class A(Model): 
     pass</p>
  
  <p>class B(Model): 
     a = ForeignKey(A)</p>
  
  <p>class C(Model): 
     b = ForeignKey(B)</p>
  
  <p>I have an instance of A called mya.</p>
  
  <p>I want to find all B's for my A, for which there is at least one C.  I can do this in one line:</p>
  
  <p>bsiwant = [c.b for c in C.objects.filter(b__a==mya)] (and uniquify it somehow)</p>
  
  <p>...but presumably that would cause many queries.  Is there a way to do it with the filter such that a single query would be performed?</p>