Question: a. Add a new form (call it DeleteForm) that defines a StringField (city) and a SubmitField (button) class DeleteForm(FlaskForm): b. create a delete.html: A template

a. Add a new form (call it DeleteForm) that defines a StringField (city) and a SubmitField (button)

class DeleteForm(FlaskForm):

b. create a delete.html: A template file

delete.html simply needs to render one input field

c. Create a route /delete.

create a DeleteForm object, and on a button click, it checks whether the city name input in the form is in the 'cities' dictonary. If it is, it deletes it from cities. The route should then redirect to the view route. The render_template sends delete.html as a argument. Remember to import DeleteForm at the top of routes.py.

google cloud platform

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!