Jinja2 Templates and Forms.
Here is the project Tourist Attractions:
I have created the following code:
AddLocationForm = add_form()
name = add_form.name.data
description = add_form.description.data
category = add_form.category.data
visit.add(name, description, category)
return redirect(url_for(“locations”, category=category))
I am getting a NameError stating that add_form is not defined. I have completed the project and was going to just move on but I figured I’d play with it a little first. I tried to use the form and submit a location but got the NameError. Am I doing something wrong? I’d like to correct it so I can feel that I REALLY got the project completed, if you know what I mean. Any help would be greatly appreciated!