Exemplo n.º 1
0
def football():
    if request.method == 'POST':
        sortby = request.form['sortby']
        sortorder = request.form['sortorder']
        seasons = model.get_football_seasons(sortby, sortorder)
    else:
        seasons = model.get_football_seasons()
    return render_template("seasons.html", seasons=seasons, ties=True)
Exemplo n.º 2
0
def football():
    if request.method == 'POST':
        sortby = request.form['sortby']
        sortorder = request.form['sortorder']
        seasons = model.get_football_seasons(sortby, sortorder)
    else:
        seasons = model.get_football_seasons()  # get default version

    return render_template("seasons_football.html", seasons=seasons)
Exemplo n.º 3
0
def fball():
    # need to be able to post on the url, so adding that in
    if request.method == 'POST':
        sortby = request.form['sortby']
        sortorder = request.form['sortorder']
        seasons = model.get_football_seasons(sortby, sortorder)
    else:
        seasons = model.get_football_seasons()

    return render_template("seasons.html", seasons=seasons)
Exemplo n.º 4
0
def football():
    if request.method == 'POST':
        sortby = request.form['sortby']
        sortorder = request.form['sortorder']
        seasons = model.get_football_seasons(sortby, sortorder)
    else:
        seasons = model.get_football_seasons()

    return render_template("football_season.html",
                           sport="Men's Football",
                           seasons=seasons)
Exemplo n.º 5
0
        sortorder = request.form['sortorder']
        seasons = model.get_bball_seasons(sortby, sortorder)
    else:
        seasons = model.get_bball_seasons()
    return render_template("seasons.html", seasons=seasons)

@app.route('/football', methods=['GET', 'POST'])
def football():
    if request.method == 'POST':
        sortby = request.form['sortby']
        sortorder = request.form['sortorder']
        seasons = model.get_football_seasons(sortby, sortorder)
    else:
        seasons = model.get_football_seasons()
    return render_template("seasons.html", seasons=seasons, ties=True)

@app.route('/hello', methods=['GET', 'POST'])
def hello():
    firstname = ''
    lastname = ''
    if request.method=='POST':
        firstname = request.form['firstname']
        lastname = request.form['lastname']
    return render_template("hello.html", firstname=firstname, lastname=lastname)

if __name__ == '__main__':
    model.init_bball()
    model.init_fball()
    print(model.get_football_seasons())
    app.run(debug=True)