tournament: add: game call func when finished

This commit is contained in:
2024-04-23 15:41:18 +02:00
parent 2a63edf739
commit 743bb7edeb
4 changed files with 29 additions and 3 deletions

View File

@ -53,7 +53,7 @@ class TournamentModel(models.Model):
return game
def get_games(self) -> list[GameModel]:
return [tournament_game.game for tournament_game in TournamentGameModel.objects.filter(tournament=self)]
return [games for games in self.get_games_by_round(i for i in range(1, self.round))]
def get_games_by_round(self, round: int) -> list[GameModel]:
return [tournament_game.game for tournament_game in TournamentGameModel.objects.filter(tournament=self, round=round)]