Merge pull request #145 from eitchtee/dev

feat(import:v1): allow to source previously mapped data by prefixing it with "__"
This commit is contained in:
Herculino Trotta
2025-02-08 15:59:56 -03:00
committed by GitHub

View File

@@ -490,9 +490,16 @@ class ImportService:
if isinstance(mapping.source, str):
value = row.get(mapping.source, None)
if not value and mapping.source.startswith("__"):
value = mapped_data.get(mapping.source[2:], None)
elif isinstance(mapping.source, list):
for source in mapping.source:
value = row.get(source, None)
if not value and source.startswith("__"):
value = mapped_data.get(source[2:], None)
if value:
break
else: