def select_member(member):
    sql = "SELECT * FROM members WHERE id=%s"
    value = [member.id]
    result = run_sql(sql, value)[0]
    if result is not None:
        club = club_repository.select_club(result["club_id"])
        member = Member(result["name"], club, result["id"])
        return member
def select_all_members():
    results = run_sql("SELECT * FROM members")
    members = []
    for result in results:
        club = club_repository.select_club(result["club_id"])
        member = Member(result["name"], club, result["id"])
        members.append(member)
    return members
Exemplo n.º 3
0
def select_all_times():
    results = run_sql("SELECT * FROM times_available")
    times = []
    for result in results:
        club = club_repository.select_club(result["club_id"])
        time = Time(result["start_time"], result["duration"], club,
                    result["id"])
        times.append(time)
    return times
Exemplo n.º 4
0
def select_time(id):
    sql = "SELECT FROM times_available WHERE id=%s"
    value = [id]
    result = run_sql(sql, value)[0]
    if result is not None:
        club = club_repository.select_club(result["club_id"])
        time = Time(result["start_time"], result["duration"], club,
                    result["id"])
        return time
def club_home_page(id):
    current_club = club_repository.select_club(id)
    return render_template('club/home.html', current_club=current_club)