Now we will create the model that we will use to represent and persist a user. Open the models.py file within the service folder and add the following lines after the declaration of the ResourceAddUpdateDelete class. Make sure that you add the highlighted import statements. The code file for the sample is included in the restful_python_2_03_02 folder, in the Flask01/service/models.py file:
from passlib.apps import custom_app_context as password_contextimport re class User(orm.Model, ResourceAddUpdateDelete): id = orm.Column(orm.Integer, primary_key=True) name = orm.Column(orm.String(50), unique=True, nullable=False) # I save the hash for the password (I don't persist the actual password) password_hash = orm.Column(orm.String(120), ...