bug fix, putting orphaned attributes in references at top level upon export

master
Steve Nyemba 3 years ago
parent 427e09870c
commit bab0040f0c

@ -84,11 +84,10 @@ def meta(config) :
config[key]['map'][field] = -100 config[key]['map'][field] = -100
add_index = {} #-- tells if we should add _index attribute or not add_index = {} #-- tells if we should add _index attribute or not
for prefix in config : for prefix in config :
# if 'map' in config[prefix] : #
# label = list(set(['label','field']) & set(config[prefix].keys())) # Running through every element that we can parse (from the configuration)
# label = None if not label else config[prefix][label[0]] # This allows us to create ER-Like structures from the data we have
# _map = config[prefix]['map'] #
# _info += (field_info(_map,label))
if type(config[prefix]) != dict : if type(config[prefix]) != dict :
continue continue
@ -98,6 +97,9 @@ def meta(config) :
_entry = config[prefix]['@ref'][subprefix] _entry = config[prefix]['@ref'][subprefix]
_id = list(set(['label','field']) & set(config[prefix]['@ref'][subprefix].keys())) _id = list(set(['label','field']) & set(config[prefix]['@ref'][subprefix].keys()))
if _id :
#
# In case a reference item has a parent field/label
_id = _id[0] _id = _id[0]
table = config[prefix]['@ref'][subprefix][_id] table = config[prefix]['@ref'][subprefix][_id]
add_index[table] = 1 if _id == 'label' else 0 add_index[table] = 1 if _id == 'label' else 0

Loading…
Cancel
Save