I'm a little bit stuck with checking if user's input is correct. I don't know how to properly call "name" and other fields inside of lookup function to check them. I've tried different combinations of parenthesis (e.g., ["name"], (name), (["name])), but none of them seem to work.
Any suggestions about this problem?
Here is my code:
if request.method == "POST":
quote = request.form.get("symbol")
result = lookup(quote)
if not result("name"):
return apology*=("invalid symbol", 403)
return render_template("quoted.html", result=result)
else:
return render_template("quote.html")