Commit 2f748712 by adamtorok

serializable image

parent b83a3a79
import json
class Image: class Image:
def __init__(self, id, name, format) -> None: def __init__(self, id, name, format) -> None:
super().__init__() super().__init__()
...@@ -5,3 +8,9 @@ class Image: ...@@ -5,3 +8,9 @@ class Image:
self.id = id self.id = id
self.name = name self.name = name
self.format = format self.format = format
def __str__(self) -> str:
return self.toJSON()
def toJSON(self):
return json.dumps(self.__dict__)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment