Skip to content
Snippets Groups Projects

Filling XLSX: Everything except multiple choice.

Merged Daniel Hornung requested to merge f-json-table into dev
Compare and Show latest version
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -204,11 +204,15 @@ class TableTemplateGenerator(ABC):
# and add the foreign keys that are necessary up to this point
for array_path in array_paths:
foreigns = self._get_foreign_keys(foreign_keys, array_path)
if isinstance(foreigns, str):
raise ValueError("Foreign keys must be a list of strings, but a single "
"string was given:\n"
f"{array_path} -> {foreigns}")
for foreign in foreigns:
internal_key = p2s(array_path + [foreign])
if internal_key in sheets[sheetname]:
raise ValueError("The schema would lead to two columns with the same "
f"name, which is forbidden: {internal_key}")
f"name, which is forbidden:\n{foreign} -> {internal_key}")
ref_sheet = p2s(array_path)
sheets[sheetname][internal_key] = (
ColumnType.FOREIGN, f"see sheet '{ref_sheet}'", array_path + [foreign])
Loading