Ejemplo n.º 1
0
def get_teams_head_to_head(id1, id2):
    team = Team.query.get(id1)

    team_games = team.games.filter(
        or_(Game.team1_id == id2, Game.team2_id == id2)).all()
    result = games_schema.dump(team_games)
    return jsonify(result.data)
Ejemplo n.º 2
0
def player_won_games(id):
    games = Player.query.get(id).donuts
    result = games_schema.dump(games)
    return jsonify(result.data)
Ejemplo n.º 3
0
def player_lost_games(id):
    games = Player.query.get(id).lost_games
    result = games_schema.dump(games)
    return jsonify(result.data)
Ejemplo n.º 4
0
def get_games():
    all_games = Game.query.all()
    result = games_schema.dump(all_games)
    return jsonify(result.data)
Ejemplo n.º 5
0
def get_team_games_lost(id):
    team = Team.query.get(id)
    team_games = team.games_lost
    result = games_schema.dump(team_games)
    return jsonify(result.data)