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 []