From 7c83a41b57773de830b4aad05e5d78da0e3f5fbe Mon Sep 17 00:00:00 2001 From: SJiB Date: Tue, 17 Dec 2024 14:51:49 +0100 Subject: [PATCH] Specify fk_relation between cover and wws --- qgepqwat2ili/utils/qgep_export_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qgepqwat2ili/utils/qgep_export_utils.py b/qgepqwat2ili/utils/qgep_export_utils.py index 80ae9fe7..d6b8ecda 100644 --- a/qgepqwat2ili/utils/qgep_export_utils.py +++ b/qgepqwat2ili/utils/qgep_export_utils.py @@ -1067,7 +1067,7 @@ def export_cover(self): # ) # filtering only on wastewater_structures that are in subset_wws_ids if self.filtered: - query = query.join(self.qgep_model.wastewater_structure).filter( + query = query.join(self.qgep_model.wastewater_structure, cover.fk_wastewater_structure = wastewater_structure.obj_id).filter( self.qgep_model.wastewater_structure.obj_id.in_(self.subset_wws_ids) ) # add sql statement to logger @@ -1116,7 +1116,7 @@ def export_cover(self): def export_cover_ws_off_sia405abwasser(self): query = self.qgep_session.query(self.qgep_model.cover) # if ws_off_sia405abwasser always filter out with subset_wws_ids - query = query.join(self.qgep_model.wastewater_structure).filter( + query = query.join(self.qgep_model.wastewater_structure, cover.fk_wastewater_structure = wastewater_structure.obj_id).filter( self.qgep_model.wastewater_structure.obj_id.in_(self.subset_wws_ids) ) # add sql statement to logger