An ORM for the EPIC WINNING
A conceptual perspective:
SQL Object Oriented Programming (OOP)
Table <-> Class
Column <-> Attribute
Row <-> Instance
ORM's allow us to use SQL using OOP concepts
Your Turn!
Spend 5 minutes and
write an OOP model that creates a book class with:
and create a book "Harry Potter" by "J.K. Rowling" from 1997
Discuss it!
Now, turn to a neighbor and discuss for 3 minutes:
How does your model relate to SQL tables, columns, and rows?
Why might it be useful generally to use an ORM?
What might some of the costs to using an ORM be?
2. Use SQLAlchemy to build Tables
Now open your flask_list_app and this:
https://github.com/gSchool/python-curriculum/blob/master/Unit-02/02-flask_sqlalchemy.md