diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-03-22 13:10:52 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-03-22 13:23:14 +0100 |
commit | a4b5f36facba9d2d8685c796acda7d4c35e3c51e (patch) | |
tree | 594e31ccbf84130a79565b70b54cbe5318e59d80 /ishtar_common/data_importer.py | |
parent | af5f58021b975d2bd4081ac80cc9976f096d3a16 (diff) | |
download | Ishtar-a4b5f36facba9d2d8685c796acda7d4c35e3c51e.tar.bz2 Ishtar-a4b5f36facba9d2d8685c796acda7d4c35e3c51e.zip |
✨ Debug mode for imports
Diffstat (limited to 'ishtar_common/data_importer.py')
-rw-r--r-- | ishtar_common/data_importer.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 90cabf0b1..b4be3d297 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -741,6 +741,7 @@ class Importer(object): MAIN_GEO = False LINE_FORMAT = [] OBJECT_CLS = None + DEBUG = False UNICITY_KEYS = [] # if set only models inside this list can be created MODEL_CREATION_LIMIT = [] @@ -835,6 +836,7 @@ class Importer(object): self._pre_import_values = self.PRE_IMPORT_VALUES.copy() self.history_modifier = history_modifier self.output = output + self.debug = [] if not self.history_modifier: if self.import_instance and self.import_instance.user: self.history_modifier = self.import_instance.user.user_ptr @@ -1189,6 +1191,10 @@ class Importer(object): continue data = update_data(defaults, data) self.validity.append(c_row) + if self.DEBUG: + debug_data = copy.deepcopy(data) + debug_data["_debug_current_line"] = idx_line + 1 + self.debug.append(debug_data) if not self.c_errors and (idx_col + 1) < self.min_col_number: self.c_errors = True self.errors.append( |