Beispiel #1
0
    def GET(self, id_round):
        # Returns a matches for each round
        playerMatches = trn.roundMatches(id_round)
        # Returns id by tournament
        id_tournament = trn.reportIdTournament(id_round)
        # Returns if exist a match for a round
        matchState = trn.reportMatchByRound(id_round)

        # Create a list of inputs with information about matches to register the result
        for playerMatch in playerMatches:
            name = "match%d" % playerMatch[0]
            self.dynamic.add_input(
                web.form.Dropdown(
                    name,
                    [
                        (str(playerMatch[3]) + "." + str(playerMatch[4]), playerMatch[1]),
                        (str(playerMatch[4]) + "." + str(playerMatch[3]), playerMatch[2]),
                        (str(playerMatch[3]) + "_" + str(playerMatch[4]), "Tied"),
                    ],
                )
            )

        self.dynamic.add_input(
            web.form.Button("save", type="submit", description="Save", class_="btn btn-lg btn-warning pull-right")
        )
        return render.result_match(id_round, id_tournament, playerMatches, matchState, self.dynamic)
Beispiel #2
0
 def GET(self, id_round):
     # Returns matches for a round
     playerMatches = trn.roundMatches(id_round)
     # Returns id for a tournament
     id_tournament = trn.reportIdTournament(id_round)
     # Returns true if exist a match for a round
     matchStatus = trn.reportMatchByRound(id_round)
     # Returns true if exist a result for match
     resultStatus = trn.reportResultByMatch(id_round)
     # Return a Bye Player
     byePlayer = trn.reportByePlayer(id_round)
     return render.player_matches(id_round, id_tournament, playerMatches, matchStatus, byePlayer, resultStatus)