From f541bb0d146e4fc5d3b9de1f1db0864be0651b54 Mon Sep 17 00:00:00 2001 From: amandine-sahl Date: Mon, 29 Jul 2024 11:26:39 +0200 Subject: [PATCH] Post rebase --- backend/gn_module_monitoring/config/generic/site.json | 4 +--- backend/gn_module_monitoring/config/utils.py | 1 + backend/gn_module_monitoring/monitoring/models.py | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/gn_module_monitoring/config/generic/site.json b/backend/gn_module_monitoring/config/generic/site.json index 1d693d724..6b472a41c 100644 --- a/backend/gn_module_monitoring/config/generic/site.json +++ b/backend/gn_module_monitoring/config/generic/site.json @@ -110,10 +110,8 @@ "definition": "Permet de n'avoir que les types de site liƩ au module" }, "id_sites_group": { - "type_widget": "integer", - "attribut_label": "ID Sites Groups", "hidden": true, - "schema_dot_table": "gn_monitoring.t_base_sites" + "required": false } } } \ No newline at end of file diff --git a/backend/gn_module_monitoring/config/utils.py b/backend/gn_module_monitoring/config/utils.py index d5a1c84f7..bb6589294 100644 --- a/backend/gn_module_monitoring/config/utils.py +++ b/backend/gn_module_monitoring/config/utils.py @@ -27,6 +27,7 @@ "application": "GeoNature", } + def monitoring_module_config_path(module_code): return SUB_MODULE_CONFIG_DIR / module_code diff --git a/backend/gn_module_monitoring/monitoring/models.py b/backend/gn_module_monitoring/monitoring/models.py index 7b78b7530..596aa6be9 100644 --- a/backend/gn_module_monitoring/monitoring/models.py +++ b/backend/gn_module_monitoring/monitoring/models.py @@ -285,12 +285,7 @@ class TMonitoringSites(TBaseSites, PermissionModel, SitesQuery): .scalar_subquery() ) - geom_geojson = column_property( - select(func.st_asgeojson(TBaseSites.geom)) - .where(TBaseSites.id_base_site == id_base_site) - .correlate_except(TBaseSites) - .scalar_subquery() - ) + geom_geojson = column_property(func.ST_AsGeoJSON(TBaseSites.geom), deferred=True) types_site = DB.relationship("BibTypeSite", secondary=cor_site_type, overlaps="sites") @hybrid_property