验证码

邮件,依赖
This commit is contained in:
resonate
2022-01-23 15:14:14 +08:00
parent 56dcc7eff8
commit ef8044ea22
19 changed files with 219 additions and 30 deletions
+10 -1
View File
@@ -2,7 +2,7 @@ import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from common.model import BaseModel, Column, Integer, String, DateTime, relationship
from common.model import BaseModel, Column, Integer, String, DateTime, relationship, SQLAlchemyAutoSchema, backref
class User(BaseModel, UserMixin):
@@ -24,3 +24,12 @@ class User(BaseModel, UserMixin):
def validate_password(self, password):
return check_password_hash(self.password_hash, password)
# 如果要全换全部字段,就不要声明fields或exclude字段即可
class UserRoleSchema(SQLAlchemyAutoSchema):
class Meta:
model = User
include_fk = True
load_instance = True
exclude = ['password_hash']