Skip to content

Commit

Permalink
allow json import config to have multiple data types for one set
Browse files Browse the repository at this point in the history
Lets you define range imports with the minimum of duplicated config
  • Loading branch information
struan committed Nov 28, 2024
1 parent fd072a5 commit f55ae8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hub/management/commands/import_from_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ def get_configs(self, import_name):
c = json.load(config)
for conf in c:
if conf["name"] == import_name:
confs.append(conf)
if conf.get("data_types"):
conf["data_set_name"] = conf["name"]
conf["data_set_label"] = conf["label"]
for dt in conf["data_types"]:
dt_conf = {**conf, **dt}
confs.append(dt_conf)
else:
confs.append(conf)

return confs

Expand Down

0 comments on commit f55ae8b

Please sign in to comment.