コード例 #1
0
ファイル: main.py プロジェクト: gdouglas1/StuffAboutFootball
def get_fixture(fixture_id: int):
    """
    Controller for retrieving Fixture data for the specified fixture ID
    :param fixture_id:
    :return:
    """
    fixture = footballapi.get_fixture(fixture_id)
    competition = footballapi.get_competition(fixture.competition_id)
    home_team = footballapi.get_team(int(fixture.home_team_id))
    away_team = footballapi.get_team(int(fixture.away_team_id))
    return render_template("fixture.html", **locals())
コード例 #2
0
ファイル: main.py プロジェクト: gdouglas1/StuffAboutFootball
def get_fixtures_for_team(team_id: int):
    team = footballapi.get_team(team_id)

    fixture_list_type = "team"
    page_title = team.name
    title_id = team_id

    all_fixtures = footballapi.get_fixtures_for_team(team_id)

    ungrouped_results = [x for x in all_fixtures if x.fixture_status == "FINISHED"]
    ungrouped_results.sort(key=operator.attrgetter('match_day'), reverse=True)
    results = footballapi.group_fixtures_by_match_day(ungrouped_results)

    ungrouped_fixtures = [x for x in all_fixtures if x.fixture_status != "FINISHED"]
    ungrouped_fixtures.sort(key=operator.attrgetter('match_day'))
    fixtures = footballapi.group_fixtures_by_match_day(ungrouped_fixtures)

    return render_template("fixtures.html", **locals())
コード例 #3
0
ファイル: main.py プロジェクト: gdouglas1/StuffAboutFootball
def get_players_for_team_ungrouped(team_id: int):
    team = footballapi.get_team(team_id)
    players = footballapi.get_players_ungrouped(team_id)

    return render_template("players.html", **locals())
コード例 #4
0
ファイル: main.py プロジェクト: gdouglas1/StuffAboutFootball
def get_players_for_team_grouped(team_id: int):
    team = footballapi.get_team(team_id)
    players_grouped = footballapi.get_players_grouped(team_id)

    return render_template("players_by_position.html", **locals())
コード例 #5
0
ファイル: main.py プロジェクト: gdouglas1/StuffAboutFootball
def get_team(team_id: int):
    team = footballapi.get_team(team_id)
    return render_template("team.html", **locals())