@classmethod
def json_dump_default(cls, o):
    """
        Override this to implement custom JSON encoding. Passed to json.dump method.
        :param o: Object which cannot be JSON-serialized.
        :return: JSON-serializable object (or throw TypeError)
        """
    raise TypeError("Can't JSON serialize {}".format(type(o).__name__))
