Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #89 from g-tom/improve_import_export
Browse files Browse the repository at this point in the history
Don't forget the load_key when importing lists.
  • Loading branch information
ThomasJunk authored Aug 31, 2017
2 parents 0aabcc6 + e10aa65 commit d3a8565
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ringo/lib/imexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,13 @@ def _deserialize_recursive(self, obj):
importer = JSONImporter(clazz, db=self._db, use_strict=self._use_strict)
if not isinstance(obj[field], list):
import_data = [obj[field]]
imported_item = importer.perform(json.dumps(import_data), load_key=self.load_key)
imported_item = importer.perform(json.dumps(import_data),
load_key=self.load_key)
obj[field] = imported_item[0][0]
elif obj[field] and isinstance(obj[field][0], dict):
import_data = obj[field]
imported_item = importer.perform(json.dumps(import_data))
imported_item = importer.perform(json.dumps(import_data),
load_key=self.load_key)
obj[field] = [x[0] for x in imported_item]
return obj

Expand Down

0 comments on commit d3a8565

Please sign in to comment.