コード例 #1
0
def handleBreakfast():
    if request.method == 'GET':
        return "You're getting the breakfast page!"
    else:
        userdata = dict(request.form)
        nickname = model.shout(userdata['nickname'])
        breakfast = model.shout(userdata['breakfast'])
        return "Hello, " + nickname + ", I heard you had " + breakfast + " for breakfast! Sounds delicious."
コード例 #2
0
def handleChoices():
    if request.method == 'GET':
        return "This is what happens when the form is not posted"
    else:
        userdata = dict(request.form)
        print(userdata)
        nickname = model.shout(userdata['nname'])
        faveColor= model.shout(userdata['breakfast'])
        age= userdata['age']
        return render_template("choices.html", nickname=nickname, faveColor=faveColor, age=age)
コード例 #3
0
def sendBreakfast():
    if request.method == 'GET':
        return "You didn't fill out the form and I bet you say 'routes' weirdly"
    else:
        userData = dict(request.form)
        nickname = userData["nickname"]
        breakfast = userData["breakfast"]
        return render_template("breakfast.html",
                               nickname=model.shout(nickname),
                               breakfast=model.shout(breakfast))
コード例 #4
0
def sendBreakfast():
    if request.method=="GET":
        return "you didnt fill out the form"
    else:
        userData = dict(request.form)
        nickname = userData["nickname"]
        nickname = model.shout(nickname)
        breakfast = userData["breakfast"]
        breakfast = model.shout(breakfast)
        return render_template("breakfast.html", nickname = nickname, breakfast = breakfast)
        
コード例 #5
0
def sendBreakfast():
    if request.method == 'GET':
        return "You didnt fill out the form and I bet u say route weirdly. "
    else:
        userData = dict(request.form)
        nickname = userData['nickname'][0]
        nickname = model.shout(nickname)
        breakfast = userData['breakfast'][0]
        breakfast = model.shout(breakfast)
        return render_template("breakfast.html",
                               nickname=nickname,
                               breakfast=breakfast)
コード例 #6
0
ファイル: routes.py プロジェクト: 2020dbril/Flipit
def results():
    userdata = dict(request.form)
    print(userdata)
    print(userdata['nickname'])
    output = model.shout(userdata['nickname'])
    print(output)
    return render_template('results.html', output=output)
コード例 #7
0
def breakfast():
    stuff = request.form
    if request.method == "GET":
        return redirect("yeetus")
    temp = request.form["breakfast"]
    temp = model.shout(temp)
    return render_template("results.html", name=stuff["nickname"], food=temp)
コード例 #8
0
def results():
    data = dict(request.form)
    print(userdata)
    userdata = eval(json.dumps(data))
    nickname = userdata['nickname']
    print(userdata['nickname'])
    output = model.shout(userdata['nickname'])
    print(output)
    return render_template('results.html')
コード例 #9
0
ファイル: routes.py プロジェクト: Ismaelleyva/Flasky
def results():
    return "this is the results page"
    userdata = dict(request.form)
    print(userdata)
    print(userdata,['nickname'])
    nickname = userdata['nickname']
    print(nickname)
    output= model.shout(userdata['nickname'])
    print(output)
    return render_template('results.html')
コード例 #10
0
def breakfast():
    if request.method == 'GET':
        return "Please use the form"    
    else:
        userdata = dict(request.form)
        print(userdata)
        nickname = userdata['nickname']
        breakfast = userdata['breakfast']
        breakfast = shout(breakfast)
        return render_template('breakfast.html', nickname = nickname, breakfast = breakfast)
コード例 #11
0
ファイル: routes.py プロジェクト: SophiaTanOfficial/Day-7
def handleBreakfast():
    if request.method == 'GET':
        user = {"name": "Sophia", 'color': 'blue', 'animal': 'fox'}
        weather = {'temperature': '70', 'cloud': 'cloudy'}
        return render_template("index.html", title = 'Home Page', user = user, weather = weather)
    else: #For post requests
        userdata = formopener.dict_from(request.form) #This puts form data into a dictionary
        nickname = userdata['nickname'] #The key for this dictionary comes from the name of the corresponding input in the <form> on the html
        breakfast = model.shout(userdata['breakfast'])
        return render_template('results.html', nickname = nickname, breakfast = breakfast)
コード例 #12
0
def handleBreakfast():
    if request.method == 'GET':
        user = {'name':'Edeline','fav_color':'pink'}
        weather = {'temperature':"70",'cloud':"cloudy"}
        return render_template('index.html', title='Home Page', user=user, weather = weather)
        
    else: ##this is for POST requests
        userdata = formopener.dict_from(request.form) #This puts form data into a dictionary
        nickname = userdata['nickname'] # the key for this dictionary comes from the name of the corresponding input in the <form> on the html
        breakfast = model.shout(userdata['breakfast'])
        return render_template('results.html',nickname = nickname, breakfast = breakfast)
コード例 #13
0
ファイル: routes.py プロジェクト: anish-bardhan/flipit
def results():
    userdata = dict(request.form)
    print(userdata['nickname'])
    output = model.shout(userdata['nickname'])
    print(output)
    return return