1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-17 20:12:22 +00:00

Added serialization of sets

This commit is contained in:
J. Fernando Sánchez
2017-06-16 12:44:25 +02:00
parent 312e7f7f12
commit 24c97256e8
2 changed files with 7 additions and 2 deletions

View File

@@ -140,7 +140,7 @@ class SenpyMixin(object):
vp = item[kp]
temp[kp] = ser_or_down(vp)
return temp
elif isinstance(item, list):
elif isinstance(item, list) or isinstance(item, set):
return list(ser_or_down(i) for i in item)
else:
return item
@@ -184,7 +184,7 @@ class SenpyMixin(object):
jsonschema.validate(obj, self.schema)
def __str__(self):
return str(self.to_JSON())
return str(self.serialize())
class BaseModel(SenpyMixin, dict):