MCS 275 Spring 2022
Emily Dumas
Course bulletins:
python3 -m pip install Flask
in preparation for using it in upcoming assignments.Build the worker view template
Create the database and link it to the Flask application
Table orders
has columns:
woid
- integer uniquely identifying a WOdescription
- stringassigned_to
- username this WO is assigned to (NULL if not assigned)time_created
- time.time()
when createdRoute /worker/ddumas/
results in:
ddumas
assigned WOsNote part of the URL is an argument. The pattern is /worker/<username>/
Buttons on the worker view form need to perform actions.
We'll make Flask routes for this, e.g. /wo/58/assign_to/ddumas/
.
Requesting that URL should perform an action. But what content will it serve?
Every HTTP request results in a numerical status.
So far, we've seen 404 (NOT FOUND) and 200 (OK, generated by Flask when we return HTML).
There are also codes that instruct the browser to load another resource, e.g. 302 (FOUND).
Return flask.redirect("destination")
to make this happen.