Coverage for src/schemas/profile_schema.py : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Profile Schemas
2from src import ma
4from src.model import ProfileModel
5from src.utils import SQLAlchemyAutoSchema, DTOSchema
7# Validations with Marshmallow
8from marshmallow import fields
9from marshmallow.validate import Regexp, Length
11# Validations with Marshmallow
12from marshmallow import fields
13from marshmallow.validate import Regexp, Length
15from src.utils import DTOSchema
18class ProfileMeta:
19 model = ProfileModel
22class ProfileBase(SQLAlchemyAutoSchema):
24 class Meta(ProfileMeta):
25 fields = ("uuid", "profilename")
28class ProfileObject(SQLAlchemyAutoSchema):
29 liked_genres = ma.Nested("GenreBase", many=True)
31 class Meta(ProfileMeta):
32 fields = ("uuid", "profilename", "liked_genres")