Skip to content
Snippets Groups Projects
Commit 3f7dd02b authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

handling of list properties or multi properties now works correctly

parent 651b25be
No related branches found
No related tags found
1 merge request!53Release 0.1
......@@ -218,33 +218,21 @@ class Converter(object):
# additionally add the new record to the general store:
values[name] = c_record
# the following rules apply:
# - all properties will be added (as they do not exist yet)
# if +$ a new list is created and an element is added
c_record = records[name]
for key, value in record.items():
if key == "parents":
continue
propvalue, collection_mode = handle_value(value, values)
if c_record.get_property(key) is None:
if collection_mode == "list":
c_record.add_property(name=key, value=[propvalue])
elif (collection_mode == "multiproperty" or
collection_mode == "single"):
c_record.add_property(name=key, value=propvalue)
else:
# the following rules apply:
# if +$ an element is added to the existing list
# if *$ the property is added (leading possibly to multiple properties)
# if just $ the property is set (and possibly overwritten)
c_record = records[name]
for key, value in record.items():
if key == "parents":
continue
propvalue, collection_mode = handle_value(value, values)
if collection_mode == "list":
c_record.get_property(key).value.append(propvalue)
elif collection_mode == "multiproperty":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment