Coverage for src/schemas/genre_schema.py : 94%
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
1from marshmallow import fields
3from src import ma
4from src.model import GenreModel
5from src.utils import SQLAlchemyAutoSchema
8class GenreMeta:
9 model = GenreModel
12class GenreBase(SQLAlchemyAutoSchema):
13 class Meta(GenreMeta):
14 fields = ("genre_id", "name", "count")
17class GenreObject(SQLAlchemyAutoSchema):
18 linked_genres = ma.Nested("GenreBase", many=True)
19 content_type = fields.Method("get_content_type")
21 def get_content_type(self, obj):
22 return obj.content_type.value
24 class Meta(GenreMeta):
25 pass