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."
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)
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))
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)
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)
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)
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)
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')
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')
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)
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)
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)
def results(): userdata = dict(request.form) print(userdata['nickname']) output = model.shout(userdata['nickname']) print(output) return return