Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def serializable(cls):
- class wrapper:
- def __init__(self, *args):
- self.wrapped = cls(*args)
- def __getattr__(self, *args):
- return getattr(self.wrapped, *args)
- def serialize(self):
- return jsonpickle.encode(self.wrapped)
- @staticmethod
- def deserialize(ser_str):
- return jsonpickle.decode(ser_str)
- return wrapper
Add Comment
Please, Sign In to add comment