Beispiel #1
0
def add_food():
    if request.method == "GET":
        return render_template("food_form.html")
    elif request.method == "POST":
        form = request.form
        n = form["name"]
        p = form["price"]
        food.add_food(n, p)
Beispiel #2
0
def add_food():
    if request.method == "GET":
        return render_template("food_form.html")
    elif request.method == "POST":
        form = request.form
        n = form["name"]
        p = form["price"]
        food.add_food(n, p)
    return 'New food has been added to list:\n' + ' Food:\n' + n + 'Price:\n' + p
def add_user():
    if request.method == "GET":
        return render_template("add_user.html")
    elif request.method == "POST":
        form = request.form
        un = form["username"]
        p = form["password"]
        food.add_food(un, p)
        return "New User added"