Cloned original exercise into practice folder. Will try to recreate exercise using starter code. Do without starter code later.
Added Log In link in html. Fixed img src. Added css for icon. (task 2 of exercise)
Fixed melon cart img src. Added css for icon. (task 3 of exercise)
WIP. Added cart dictionary to session. Using for loop inside cart.html to loop through melons list from shopping_cart. Formatted prices.
Add 'total' to shopping cart for loop. Format in HTML.
Add attr to Customer object, add query to get_customer_by_email
get_customer_by_email only returns row, not customer. (nowhere do I use Customer class.) add that row to session in melons.py
Where I left off on original practice files
Initial commit for practice2 - using existing templates and db
Set up basic flask app in melons.py. Copied over static files for styling and images
Add connection function to model.py. In melons, begin to add /melons handler
Import model.py as model in order to query db. Moved DB query to model.py for better compartmentalization
Call model.get_all_melons from melons.py. However, template does not match results from query, because I have not set up a Melon class yet. Nor a customer class.
Remove global vars for CONN and DB. These vars can stay local, since model will be imported anyway
in get_all_melons, query the DB for top 30 results of melon table. iterate over fetchall rows to create melon instances with Melon class. NOTE: must create cursor inside get_all_melons using connect function.
Had forgotten to wrap returned row from melon_by_id query in a Melon class object. Now melon_id functionality works. Use <int:id> to pass variable to route.
Fixed typo in price_str(), now details page displays price