Work Session v1.0.0

Read the directions for the Project

  • View the assignment in Canvas
  • Canvas > Modules > Week 5 > What to Do in Week 5, or
  • Canvas > Modules > Week 6 > What to Do in Week 6

Sketch the interactions

This time when we sketch the user interactions, we’ll still keep the same format in our sketch where we indicate pseudo code and what data is being used at each step. We’ll still be gathering form data from the user. But CSVs are now only a way for us to load initial data, and our data will come from interactions with a database instead.

In our sketch today, let’s focus on the flowers route, which you should already have set up. The route will now need to be updated for use with a database – feel free to reference your previous sketches.

Divide a piece of paper into three sections.

  • Label the first section index.html
  • Label the second section app.py
  • Label the third section flowers.html

sketch of an interaction from project v1.0.0

In the first section, the user clicks on “Flowers” in the navigation.

  • Write the link (using Jinja and url_for())

Draw an arrow to the middle section.

In the second section, indicate:

  • Route: /flowers/
  • Function definition: flowers()
  • Template to render: flowers.html
  • Is there any data coming in from the first section? no
  • Is there any that needs to be processed or gathered? yes, “flowers” database table
  • Is there any data to send on to the HTML template? yes, “all_flowers”

Don’t worry about writing the code here. Just write down the important bits.

Draw an arrow to the third section. Indicate any data that has been passed to the page, and note what the page is for (e.g. all_flowers, a list of dictionaries)

Repeat this process for the rest of the routes we have asked you to create. Reference your interaction sketches as you code.

Begin coding

Begin coding, keeping in mind the entire user interaction from a click on a link, to the route in app.py, to the resulting rendered HTML template.