问题
Does Django ORM support join like INNER JOIN, LEFT JOIN, RIGHT JOIN AND OUTER JOIN?
I read the document, and did not found one.
For example how can I do this?
SELECT *
FROM auth_user_groups
JOIN test_groups ON auth_user_groups.group_id=test_groups.group_id
WHERE test_id='1'
AND user_id='2'
LIMIT 1
test_group is a Many to many table, without any model class.
回答1:
No. Use relational fields and appropriately-crafted queries to perform joins instead.
来源:https://stackoverflow.com/questions/6001744/does-django-support-join