Import and Setup:

  • in “_ _ init _ _”, objects and db objects are stored
    • Lines like database, app.config[SQLALCHEMY_TRACK_MODIFICATIONS] and others are found in _ _ init _ _ (imported)
    • Don’t need to redefine

DB Models:

  • Class: Basis for OOP coding (encapsulator for code)
    • Way to purify the code and keep it separate from rest of the code
    • Reference code through this class
  • db.model: addition of code from different library that creates the SQLite table
    • Pull and push from a table (DB)
    • Data types defined when adding new data to table
  • Class is singular, table is plural (example: class User and table Users)

CRUD

  • Important for updating, reading, creating, and deleting