Define Your First Model Class
Map a Python class to a database table.
A Model Is a Table
In the ORM world, one Python class equals one database table. Each model describes the shape of the rows it will store. 🧱
Inherit from db.Model
Your class subclasses db.Model. That single base class gives it table powers like querying and saving for free.
class User(db.Model):
passAll lessons in this course
- Install and Configure the Extension
- Define Your First Model Class
- Columns, Types, and Constraints
- Create the Schema with create_all