le caca coule au cucu

This commit is contained in:
2024-03-25 16:11:07 +01:00
parent 2cc4a088f0
commit 7ac835e611
7 changed files with 20 additions and 11 deletions

View File

@ -19,9 +19,10 @@ class TournamentModel(models.Model):
level = models.IntegerField()
started = models.BooleanField(default = False)
finished = models.BooleanField(default = False)
gamemode = models.CharField(max_length = 50, default = "pong")
def create_game(self, level, players_id):
game_id = GameModel().create(players_id = players_id)
game_id = GameModel().create(self.gamemode, players_id = players_id)
TournamentGamesModel(game_id = game_id, tournament_id = self.pk, tournament_level = level).save()
return game_id