use new api
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2022-02-13 20:56:17 +01:00
parent 388ec47078
commit caa84189ea
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,8 @@ from .marshm import ma
from model import Ingredient from model import Ingredient
class IngredientSchema(ma.ModelSchema): class IngredientSchema(ma.SQLAlchemyAutoSchema):
class Meta: class Meta:
model = Ingredient model = Ingredient
load_instance = True

View File

@ -4,10 +4,11 @@ from model import Meal
from .ingredientschema import IngredientSchema from .ingredientschema import IngredientSchema
class MealSchema(ma.ModelSchema): class MealSchema(ma.SQLAlchemyAutoSchema):
# A list of author objects # A list of author objects
authors = ma.Nested(IngredientSchema, many=True) authors = ma.Nested(IngredientSchema, many=True)
class Meta: class Meta:
model = Meal model = Meal
load_instance = True