meal_homework/mealapi/schemas/mealschema.py
Torma Kristóf 00cacf77b7
All checks were successful
continuous-integration/drone/push Build is passing
all resources done
2022-02-13 22:32:40 +01:00

14 lines
301 B
Python

#!/usr/bin/env python3
from .marshm import ma
from model import Meal
from .ingredientschema import IngredientSchema
class MealSchema(ma.SQLAlchemyAutoSchema):
ingredients = ma.Nested(IngredientSchema, many=True, required=True)
class Meta:
model = Meal
load_instance = True