From a1f3bf890385e0d0ff05e234f65f59d53535b2e7 Mon Sep 17 00:00:00 2001 From: SJiB Date: Mon, 17 Jun 2024 19:58:50 +0200 Subject: [PATCH] same to qgepdss and qgepsia405 --- qgepqwat2ili/qgepdss/export.py | 3 +++ qgepqwat2ili/qgepsia405/export.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/qgepqwat2ili/qgepdss/export.py b/qgepqwat2ili/qgepdss/export.py index fe81abb1..1d137aa1 100644 --- a/qgepqwat2ili/qgepdss/export.py +++ b/qgepqwat2ili/qgepdss/export.py @@ -32,6 +32,9 @@ def qgep_export(selection=None, labels_file=None, orientation=None): abwasser_session = Session(utils.sqlalchemy.create_engine(), autocommit=False, autoflush=False) tid_maker = utils.ili2db.TidMaker(id_attribute="obj_id") + # backport from tww https://github.com/teksi/wastewater/blob/3acfba249866d299f8a22e249d9f1e475fe7b88d/plugin/teksi_wastewater/interlis/interlis_model_mapping/interlis_exporter_to_intermediate_schema.py#L83 + abwasser_session.execute(text("SET CONSTRAINTS ALL DEFERRED;")) + # Filtering filtered = selection is not None subset_ids = selection if selection is not None else [] diff --git a/qgepqwat2ili/qgepsia405/export.py b/qgepqwat2ili/qgepsia405/export.py index 90e5e58a..bd8b3772 100644 --- a/qgepqwat2ili/qgepsia405/export.py +++ b/qgepqwat2ili/qgepsia405/export.py @@ -29,6 +29,9 @@ def qgep_export(selection=None, labels_file=None, orientation=None): abwasser_session = Session(utils.sqlalchemy.create_engine(), autocommit=False, autoflush=False) tid_maker = utils.ili2db.TidMaker(id_attribute="obj_id") + # backport from tww https://github.com/teksi/wastewater/blob/3acfba249866d299f8a22e249d9f1e475fe7b88d/plugin/teksi_wastewater/interlis/interlis_model_mapping/interlis_exporter_to_intermediate_schema.py#L83 + abwasser_session.execute(text("SET CONSTRAINTS ALL DEFERRED;")) + # Filtering filtered = selection is not None subset_ids = selection if selection is not None else []