title: In Django, how do I query that all of the related objects have the same value for a certain field?
body: <p>Let's say I have the following models in Django:</p>
  
  <pre><code>    class Parent(models.Model):
          pass
  
      class Child(models.Model):
          parent = models.ForeignKey(Parent, related_name='children', null=True)
          foo = models.CharField(max_length=5, blank=True, null=True)
  </code></pre>
  
  <p>How would I query the <code>Parent</code> model to find all <code>Parent</code> records where ALL of it's <code>children</code> have a value of 'ABC' for <code>foo</code>?</p>
  
  <p>If I run:
  <code>Parent.objects.filter(children__foo='ABC')</code>, it returns <code>Parent</code> objects where at least one of it's <code>children</code> has a value of 'ABC' for <code>foo</code>, which is not what I want. Any help is appreciated, thank you.</p>