Skip to content

Commit

Permalink
[Monitoring individuals] [feat] Indiduals medias : add schema
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Jan 7, 2025
1 parent adff0b6 commit 681c799
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/geonature/core/gn_monitoring/schema.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand All @@ -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)

0 comments on commit 681c799

Please sign in to comment.