You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
371 B
19 lines
371 B
from flask_marshmallow import Marshmallow
|
|
from marshmallow import fields
|
|
|
|
from .models import User
|
|
|
|
ma = Marshmallow()
|
|
|
|
|
|
class UserSchema(ma.SQLAlchemySchema): # type: ignore
|
|
class Meta:
|
|
model = User
|
|
|
|
id = fields.Int()
|
|
email = fields.Str()
|
|
active = fields.Bool()
|
|
|
|
|
|
user_schema = UserSchema()
|
|
user_schema_public = UserSchema(only=("id", "email"))
|
|
|