This commit is contained in:
parent
388ec47078
commit
caa84189ea
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user