HW5: Basic Flask App
Due: Monday, Nov 4th
Image source:
flask
This is an individual assignment, but it adds to your group's project. Each member of your group will select a different major table from your project database and create a basic Flask app that allows the data in that table to be managed.
Objectives¶
- Create a simple Flask app that implements all the CRUD operations on a single table in your group's database.
Instructions¶
Use the Flask app in the profs repository as a guide. Create an app with 3 routes which provide 3 pages with the following functionality:
Main Page¶
This is a simple page containing links to the functionality of the other 2 pages. Put your name on this web page. If you want to, you may merge the main pages of each group member together into one group main page, or leave them separate until the next group assignment.
The 3 links under your name should be:
- a link to the table view page
- a link to the insert-update-delete page in
update
mode for one key from the table - a link to the insert-update-delete page in
insert
mode
Table View Page¶
This page should use a Google Charts Table to display the all the rows of the database table.
- If a row in the table is clicked, the insert-update-delete page in
update
mode should be opened with the data from the clicked row filled in. - The page should have an Add button which opens the insert-update-delete page in
insert
mode.
Insert-Update-Delete Page¶
This table should consist of text boxes, one for each column in the database. It should have a Cancel button. It will also contain other buttons, which depend on the page's mode:
Insert
mode¶
In this mode there should be an Insert button. The data entered into the text fields should be inserted into the table.
Update
mode¶
In this mode there should be an Update which updates the row whose data was displayed with any new data entered by the user. There should also be a Delete button, which deletes the row whose data was displayed.
Submission¶
This assignment should be submitted by pushing the work into your group's repository. You will have to coordinate with your group members to set up the correct directory structure and to make sure you each choose a different table.
Follow the profs example for the file and folder structure.