Consider the following models
from app import db from sqlalchemy import func class User(db.Model): id = db.Column(db.In