Hide keyboard shortcuts

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 

3 

4from src.model import ProfileModel 

5from src.utils import SQLAlchemyAutoSchema, DTOSchema 

6 

7# Validations with Marshmallow 

8from marshmallow import fields 

9from marshmallow.validate import Regexp, Length 

10 

11# Validations with Marshmallow 

12from marshmallow import fields 

13from marshmallow.validate import Regexp, Length 

14 

15from src.utils import DTOSchema 

16 

17 

18class ProfileMeta: 

19 model = ProfileModel 

20 

21 

22class ProfileBase(SQLAlchemyAutoSchema): 

23 

24 class Meta(ProfileMeta): 

25 fields = ("uuid", "profilename") 

26 

27 

28class ProfileObject(SQLAlchemyAutoSchema): 

29 liked_genres = ma.Nested("GenreBase", many=True) 

30 

31 class Meta(ProfileMeta): 

32 fields = ("uuid", "profilename", "liked_genres")