TypeError: create_view() got an unexpected keyword argument 'cls'
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(255))
last_name = db.Column(db.String(255))
email = db.Column(db.String(255), unique=True)
password = db.Column(db.String(255))
active = db.Column(db.Boolean())
confirmed_at = db.Column(db.DateTime())
roles = db.relationship('Role', secondary=roles_users,
backref=db.backref('users', lazy='dynamic'))
def __str__(self):
return self.email
# 返回值为空,或者,类型不是str flask-admin会报错,TypeError: __str__ returned non-string (type NoneType)
# During handling of the above exception, another exception occurred:
# TypeError: create_view() got an unexpected keyword argument 'cls'