We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ec43ba commit d051915Copy full SHA for d051915
object-serializer/serializer.py
@@ -2,10 +2,17 @@
2
3
def serialize(object):
4
5
+ ''' Serializes a class object into json '''
6
attribute_list = [attr for attr in dir(object) if not attr.startswith('__')]
7
attributes_dict = {}
8
9
for attribute in attribute_list:
- attributes_dict[attribute] = object.__getattribute__(attribute)
10
+ attributes_dict[attribute] = getattr(object, attribute)
11
- return json.dumps(attributes_dict, indent=2)
12
+ return json.dumps(attributes_dict, indent=2)
13
+
14
15
+def deserialize(content ,class_to_deserialize):
16
+ json_content = json.loads(content)
17
+ if type(json_content) == list:
18
+ pass
0 commit comments