Beispiel #1
0
def teams_pdf():
    teams = Team.query.all()
    title = EventSettings.query.first().name
    team_report = render_template("teams/team_report.html",
                                  teams=sorted(teams, key=by_team),
                                  title="Team Report: %s" % title)
    pdf = create_pdf(team_report, 'teams.pdf')
    return pdf
Beispiel #2
0
def category_results_pdf():
    teams = Team.query.all()
    title = EventSettings.query.first().name
    data = render_template("teams/category_results.html",
                           teams=sorted(teams, key=by_team),
                           title="Category Results Report: %s" % title)

    pdf = create_pdf(data, 'category_results.pdf')
    return pdf
Beispiel #3
0
def matches_pdf():
    matches = Match.query.all()
    competition_tables = CompetitionTable.query.all()
    title = EventSettings.query.first().name
    match_report = render_template("matches/match_report.html",
                                   matches=matches,
                                   competition_tables=competition_tables,
                                   title="Match Report: %s" % title)
    pdf = create_pdf(match_report, 'matches.pdf')
    return pdf
Beispiel #4
0
def matches_pdf():
    matches = Match.query.all()
    competition_tables = CompetitionTable.query.all()
    title = EventSettings.query.first().name
    match_report = render_template("matches/match_report.html",
                                   matches=matches,
                                   competition_tables=competition_tables,
                                   title="Match Report: %s" % title)
    pdf = create_pdf(match_report, 'matches.pdf')
    return pdf
Beispiel #5
0
def ranks_pdf():
    teams = Team.query.all()

    title = EventSettings.query.first().name
    ranked_teams = sorted(teams, key=by_team_best, reverse=True)
    for i, team in enumerate(ranked_teams):
        team.rank = i + 1

    ranks = render_template("scoring/ranks.html",
                            teams=ranked_teams,
                            title="Ranking Report: %s" % title)

    pdf = create_pdf(ranks, 'ranks.pdf')
    return pdf
Beispiel #6
0
def awards_pdf():
    award_winners = AwardWinner.query.all()
    title = EventSettings.query.first().name

    award_winners = sorted(award_winners, key=lambda x: x.friendly_award_name)
    for winner in award_winners:
        winner.category_name = AwardCategory(winner.category_id).friendly_name

    awards = render_template("awards/awards_report.html",
                             award_winners=award_winners,
                             title="Award Winners Report: %s" % title)

    pdf = create_pdf(awards, 'awards_report.pdf')
    return pdf
Beispiel #7
0
def ranks_pdf():
    teams = Team.query.all()
    
    title = EventSettings.query.first().name
    ranked_teams = sorted(teams, key=by_team_best, reverse=True)
    for i, team in enumerate(ranked_teams):
        team.rank = i + 1

    ranks = render_template("scoring/ranks.html",
                            teams=ranked_teams,
                            title="Ranking Report: %s" % title)
    
    pdf = create_pdf(ranks, 'ranks.pdf')
    return pdf
Beispiel #8
0
def awards_pdf():
    award_winners = AwardWinner.query.all()
    title = EventSettings.query.first().name

    award_winners = sorted(award_winners, key=lambda x: x.friendly_award_name)
    for winner in award_winners:
        winner.category_name = AwardCategory(winner.category_id).friendly_name

    awards = render_template("awards/awards_report.html",
                             award_winners=award_winners,
                             title="Award Winners Report: %s" % title)

    pdf = create_pdf(awards, 'awards_report.pdf')
    return pdf