 <p>It's <code>x = Foo.objects.get(bar__id=2)</code> with double underscore.</p> <p>django <a href="https://docs.djangoproject.com/en/1.9/topics/db/queries/#retrieving-specific-objects-with-filters" rel="nofollow">doc</a>.</p>