From 97a5de54eececaa7ef798617a148d1bda407beab Mon Sep 17 00:00:00 2001 From: signedav Date: Thu, 7 Dec 2023 14:57:06 +0100 Subject: [PATCH] Support of --replace on basket-handled data imports. Integrated in UpdateDataConfiguration, since --replace handles the same parameters like --update. The parameter that decides is delete_data. This because like this it's equivalent to the delete_data parameter on import. --- modelbaker/iliwrapper/ili2dbconfig.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modelbaker/iliwrapper/ili2dbconfig.py b/modelbaker/iliwrapper/ili2dbconfig.py index 40dd667..351bc25 100644 --- a/modelbaker/iliwrapper/ili2dbconfig.py +++ b/modelbaker/iliwrapper/ili2dbconfig.py @@ -380,6 +380,7 @@ def __init__(self): super().__init__() self.xtffile = "" self.dataset = "" + self.delete_data = False self.with_importtid = False self.with_importbid = False @@ -387,7 +388,10 @@ def to_ili2db_args(self, extra_args=[], with_action=True): args = list() if with_action: - self.append_args(args, ["--update"]) + if self.delete_data: + self.append_args(args, ["--replace"]) + else: + self.append_args(args, ["--update"]) self.append_args(args, extra_args)