base = declarative_base(metadata=metadata, cls=Model, name='Model',
    metaclass=_BoundDeclarativeMeta)
base.query = _QueryProperty(self)
return base
Changing constraint naming conventions in Flask-SQLAlchemy