Skip to content
Snippets Groups Projects
Commit 142694ff authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Ordered dict for Musterdatenkatalog

parent 2858a621
No related branches found
No related tags found
1 merge request!12Verwendung des Musterdatenkatalog und Revert "überflüssige Dateien gelöscht"
This commit is part of merge request !12. Comments created here will be created in the context of that merge request.
...@@ -471,9 +471,10 @@ def odsh_load_mdk_sample_dataset(): ...@@ -471,9 +471,10 @@ def odsh_load_mdk_sample_dataset():
default_sample_data_file_path = os.path.join(path, "../../mdk_mapping.json") default_sample_data_file_path = os.path.join(path, "../../mdk_mapping.json")
sample_data_file_path = config.get( sample_data_file_path = config.get(
'ckanext.odsh.sample_data_file_path', default_sample_data_file_path) 'ckanext.odsh.sample_data_file_path', default_sample_data_file_path)
try: try:
with open(sample_data_file_path) as mapping_json: with open(sample_data_file_path) as mapping_json:
MDK_MAPPING = json.loads(mapping_json.read()) MDK_MAPPING = json.loads(mapping_json.read(), object_pairs_hook=OrderedDict)
result = [{'key': key, 'value': MDK_MAPPING[key]} for key in MDK_MAPPING] result = [{'key': key, 'value': MDK_MAPPING[key]} for key in MDK_MAPPING]
except IOError as err: except IOError as err:
log.error( log.error(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment