I have the following Model:
class Group(models.Model):member = models.ManyToManyField(Player, through='GroupMember')name = models.CharField(max_length=20, unique=True)join_password = models.CharField(max_length=20)date_created = datetime.datetime.now()def __unicode__(self):return str(self.name)class GroupMember(models.Model):member = models.ForeignKey(Player)group = models.ForeignKey(Group)rating = models.IntegerField(default=1500)played = models.IntegerField(default=0)wins = models.IntegerField(default=0)losses = models.IntegerField(default=0)experience = models.IntegerField(default=0)admin = models.BooleanField(default=0)
As you can see the group is made up of members who are players. What I would like to do is given two players I would like to be able to filter the groups that contain both of these players but I am unsure how to do this type of query.