Fixed double shift implementation. Added implicit renaming
This commit is contained in:
@@ -45,7 +45,7 @@ class DefaultDataPresenter(DataPresenter):
|
||||
mappings[key] = key
|
||||
elif key.endswith(".*"):
|
||||
# all fields in a sub-object
|
||||
if value != "*":
|
||||
if value != "*" and value != "":
|
||||
raise ValueError("Only '*' is accepted when renaming wildcard.")
|
||||
obj_path = key[:-2]
|
||||
sub_obj = data.get(obj_path)
|
||||
@@ -86,6 +86,8 @@ class DefaultDataPresenter(DataPresenter):
|
||||
for mapping in self._split_definitions:
|
||||
if "=" in mapping:
|
||||
key, value = [s.strip() for s in mapping.split('=', 1)]
|
||||
if not value:
|
||||
value = key.split(".")[-1]
|
||||
mappings[key] = value
|
||||
else:
|
||||
mappings[mapping] = mapping
|
||||
|
||||
Reference in New Issue
Block a user