[docs]classBaseModel:""" Base model for ORM classes. """__allow_unmapped__=Truedef__str__(self):""" Return a string representation of the {cls.__name__} formatted to print. :return: The {cls.__name__} as a string for printing. """raiseNotImplementedError
[docs]@classmethoddeffrom_data(cls,data:Dict)->"BaseModel":""" Create a Model from serialised data. :param data: Serialised model data. :return: The created model. """raiseNotImplementedError
[docs]defdata(self,recurse:bool=False)->Dict:""" Serialise the {cls.__name__}. :param recurse: If True also serialise any contained models, otherwise only serialise simple fields. :return: The serialised data. """raiseNotImplementedError