Reputation: 3804
So I have this model Game that has an Awayteam and Hometeam field. Now I want to get all the games of a certain club. So I need to get all objects in which my club is an away team or a hometeam.
I could do:
Game.object.filter(hometeam=myteam)
and a a seperate Game.object.filter(awayteam=myteam)
query.
However, can I combine these queries into one with django?
Upvotes: 1
Views: 148