Base model
SQLAlchemy is most famous for its object-relational mapper (ORM), an optional component that provides the data mapper pattern, where classes can be mapped to the database in open-ended, multiple ways, allowing the object model and database schema to develop in a cleanly decoupled way from the beginning. We are using the Flask-SQLAlchemy extension here, which extends the support of SQLAlchemy. Flask-SQLAlchemy enhances the features that may need to be integrated with the Flask application.
We are going to combine the generic SQL operations which are required to interact by using Flask-SQLAlchemy. Hence, we are going to create a base model class and will use this class for other modules' model classes. That's the reason we are putting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access