class Team(models.Model):
college = models.CharField(max_length=20)
image = models.FileField(upload_to='documents/',null=True)
def __str__(self):
return self.college
class Athletics(Match):
time = ?
player = models.ManyToManyField(Player, related_name='player')
game_level = models.CharField(max_length=256, null=True, choices=LEVEL_CHOICES) # like semi-final, final etc
game_specific = models.CharField(max_length=256,null=True, choices=EVENT_CHOICES) #like Men's Shot Put or Men's Triple Jump etc
def __str__(self):
return str(self.game_level)
我正在为体育比赛制作田径运动模型。我有一个现有的球员模型,其中列出了球员名称和他们的球队。现在您可以看到,我已经将玩家字段添加为ManyToManyField以供选择4-5个玩家匹配。现在我需要每个球员的完成时间来判断谁有资格参加下一轮比赛。只能在此模型中执行此操作吗?还是我必须添加其他模型?帮我!
PIPIONE
相关分类