Esempio n. 1
0
def rounds_page():
    drinks = dbc.get_all_drinks()
    teams = dbc.get_all_teams()
    people = dbc.get_all_people(drinks, teams)
    rounds = dbc.get_all_rounds(people, teams)
    orders = dbc.get_all_orders(drinks, people, rounds)
    return render_template('rounds.html', title="Rounds", rounds=rounds)
Esempio n. 2
0
def get_rounds():
    drinks = dbc.get_all_drinks()
    teams = dbc.get_all_teams()
    people = dbc.get_all_people(drinks, teams)
    rounds = dbc.get_all_rounds(people, teams)
    orders = dbc.get_all_orders(drinks, people, rounds)
    return jsonify([round.to_json() for round in list(rounds.values())])
Esempio n. 3
0
def view_orders():
    if request.method == "POST":
        result = request.form.to_dict()
        round_id = int(result["round_id"])

        drinks = dbc.get_all_drinks()
        teams = dbc.get_all_teams()
        people = dbc.get_all_people(drinks, teams)
        rounds = dbc.get_all_rounds(people, teams)
        orders = dbc.get_all_orders(drinks, people, rounds)

        round_title = rounds[round_id].__str__()

        return render_template('view_orders.html',
                               title="Orders",
                               orders=orders,
                               round_id=round_id,
                               round_title=round_title)