I have the following class
class User(db.Model, UserMixin):
user = peewee.CharField(max_length=255)
email = peewee.CharField(max_length=256)
class UserRoles(db.Model):
user = peewee.ForeignKeyField(User, related_name="roles")
I have export FLASK_APP=run.py
so when I run flask create_user (jsut a test user) from terminalI get the error saying:
Unexpected value for "rel_model" Expected "Model", "Proxy", "DeferredRelation", or "self"
Try putting userMixin as the first class -- then db.Model as the second. Multi-inheritance is a bit weird with Python.