This commit is contained in:
parent
388ec47078
commit
caa84189ea
@ -3,7 +3,8 @@ from .marshm import ma
|
||||
from model import Ingredient
|
||||
|
||||
|
||||
class IngredientSchema(ma.ModelSchema):
|
||||
class IngredientSchema(ma.SQLAlchemyAutoSchema):
|
||||
|
||||
class Meta:
|
||||
model = Ingredient
|
||||
load_instance = True
|
||||
|
@ -4,10 +4,11 @@ from model import Meal
|
||||
from .ingredientschema import IngredientSchema
|
||||
|
||||
|
||||
class MealSchema(ma.ModelSchema):
|
||||
class MealSchema(ma.SQLAlchemyAutoSchema):
|
||||
|
||||
# A list of author objects
|
||||
authors = ma.Nested(IngredientSchema, many=True)
|
||||
|
||||
class Meta:
|
||||
model = Meal
|
||||
load_instance = True
|
||||
|
Loading…
Reference in New Issue
Block a user