Code source de geonature.core.imports.schemas

from geonature.utils.env import db, ma
from marshmallow import EXCLUDE

from utils_flask_sqla.schema import SmartRelationshipsMixin

from geonature.core.imports.models import Destination, FieldMapping, MappingTemplate
from geonature.core.gn_commons.schemas import ModuleSchema
from marshmallow import fields


[docs] class DestinationSchema(SmartRelationshipsMixin, ma.SQLAlchemyAutoSchema):
[docs] class Meta:
[docs] model = Destination
[docs] include_fk = True
[docs] load_instance = True
[docs] sqla_session = db.session
[docs] module = ma.Nested(ModuleSchema)
[docs] class MappingSchema(ma.SQLAlchemyAutoSchema):
[docs] class Meta:
[docs] model = MappingTemplate
[docs] include_fk = True
[docs] load_instance = True
[docs] sqla_session = db.session
[docs] cruved = fields.Dict()
[docs] values = fields.Dict()