As we have just been over in the previous section, Flask-way of doing things involves using the tools you are most comfortable with. In our article, we will be using – perhaps – the most common (and sensible) of choices in terms of extensions and libraries (i.e. database extraction layer). These choices will involve:
# Import the database object (db) from the main application module # We will define this inside /app/__init__.py in the next sections. from app import db
# Define a base model for other database tables to inherit classBase(db.Model):