title: Efficient querying of Django queryset intersection with different models
body: <p>I'm trying to do a slightly more complicated Django queryset interaction and I've run into a hurdle.</p>
  
  <pre><code>class A(models.Model):
      owner = models.ForeignKey(User)
      x = models.CharField(max_length=10)
      y = models.CharField(max_length=10)
  
  class B(models.Model):
      owner = models.ForeignKey(User)
      x = models.CharField(max_length=10)
      y = models.CharField(max_length=10)
  
  a_queryset = user.a_set.filter(x__in=("foo", "bar", "baz"))
  b_queryset = B.objects.filter(???)
  </code></pre>
  
  <p>Anyone happen to know of an efficient way to generate a queryset of B objects that have the same x/y pairs as a given A queryset? Is there a quick way of doing this given an arbitrary a_queryset?</p>