Django - Using a complex query

I've read almost all of the related questions and still can't figure out how to execute the following query in Django.

Using the Django standard tables for Auth I've added a group called 'approvers'. I need to query to return all approvers. In SQLite designer I developed the following sql:

select, auth_user.first_name, auth_user.last_name 
     auth_user, auth_user_groups 
 where = auth_user_groups.user_id
     auth_user_groups.group_id in 
          ( select from auth_group where = "approvers")

It seems that I should be able to do this by using the raw method on the models, but would like to understand how to use the Django ORM to access this if it's a better more acceptable approach.

You can .filter(…) [Django-doc] with:

Back to Top