Hey guys,
I am kind of stuck...
This is the situation. I got a Match Model, a Player Model and a Team model.
Here is what models look like so far:
Match Model (simplified version)
home_team = ForeignKey(Team)
visitor_team = ForeignKey(Team)
result
time
player = ManyToManyField(Player)
Player Model (simplified version)
name
team = ForeignKey(Team)
Team Model (simplified version)
name
Match has many to many relationship with Player (Player particiaptes in a match) Match has a foreign field Home Team Match has a foreign field Visitor Team.
Team has a one to many relationship with Player
What I would like to do is when editing the match, be able to see 2 manytomany fields but filtered by teams. For example, the first manytomany field will only show players from the host team and the second manytomany field will only show players form the visitor team...
I have no idea where to start.... Really stuck...
Thanks a lot, Ara