title: Converting a Query to Django ORM Code
body: <p>I want to perform this query to get the id of all the groups that are associated with the table auth_group_permissions.</p>
  
  <pre><code>select id from auth_group where id in (select group_id from auth_group_permissions group by group_id)
  </code></pre>