From 352f607da4bacefefa2ec562cb4bd4d10daf5272 Mon Sep 17 00:00:00 2001 From: amandine-sahl Date: Tue, 7 Jan 2025 09:55:09 +0100 Subject: [PATCH] [feat] Indiduals medias : add schema --- backend/geonature/core/gn_monitoring/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/geonature/core/gn_monitoring/schema.py b/backend/geonature/core/gn_monitoring/schema.py index 32d48c6834..787897e840 100644 --- a/backend/geonature/core/gn_monitoring/schema.py +++ b/backend/geonature/core/gn_monitoring/schema.py @@ -1,6 +1,6 @@ from marshmallow import fields -from geonature.core.gn_commons.schemas import ModuleSchema +from geonature.core.gn_commons.schemas import ModuleSchema, MediaSchema from geonature.utils.env import MA from geonature.core.gn_monitoring.models import TIndividuals, TMarkingEvent from pypnnomenclature.schemas import NomenclatureSchema @@ -14,6 +14,7 @@ class Meta: load_instance = True operator = MA.Nested(UserSchema, dump_only=True) + medias = MA.Nested(MediaSchema, many=True) class TIndividualsSchema(MA.SQLAlchemyAutoSchema): @@ -26,3 +27,4 @@ class Meta: digitiser = MA.Nested(UserSchema, dump_only=True) modules = fields.List(MA.Nested(ModuleSchema, dump_only=True)) markings = fields.List(MA.Nested(TMarkingEventSchema, dump_only=True)) + medias = MA.Nested(MediaSchema, many=True)