def put(cls, tournament_id): sumPoints = ScoreModel.get_all_members(tournament_id) sumPoints = ScoreModel.pb_summary(sumPoints) if sumPoints: for row in sumPoints: row.save_to_db() return {"scores": [row.json() for row in ScoreModel.get_finalists(tournament_id)]}
def put(cls, tournament_id): tournament = ScoreModel.get_all_members(tournament_id) number = len(tournament) tournament = ScoreModel.get_number_of_tables(number, tournament) if tournament: for row in tournament: row.save_to_db() return {"scores": [row.json() for row in ScoreModel.find_all(tournament_id)]}
def put(cls, tournament_id, user_id): tournament = ScoreModel.get_all_members(tournament_id) user = ScoreModel.get_user(user_id) tournament = ScoreModel.add_second_tie_breaker(tournament, user, user_id) if tournament: for row in tournament: row.save_to_db() return {"scores": [row.json() for row in ScoreModel.find_all(tournament_id)]}
def put(cls, tournament_id): check_owners = ScoreModel.get_all_members(tournament_id) groups2 = [] if check_owners: for row in check_owners: if row.has_own_game: row.group2 = row.group1 groups2.append(row.group2) row.save_to_db() tournament = ScoreModel.get_group2(tournament_id) number = len(tournament) tournament = ScoreModel.get_number_of_tables2(number, tournament, groups2) if tournament: for row in tournament: row.save_to_db() return {"scores": [row.json() for row in ScoreModel.find_all(tournament_id)]}