class IntervalSchema(Schema): """Schema for ``timer.Interval``""" start = custom_fields.UTCDateTime() end = custom_fields.UTCDateTime(allow_none=True) @post_load def make_interval(self, data, **kwargs): """Create an Interal object.""" return timing.Interval(**data)
class ReportLogSchema(Schema): """Schema for log record data created by report stdout.""" message = fields.String() levelname = fields.String() levelno = fields.Integer() created = custom_fields.UTCDateTime() funcName = fields.String() lineno = fields.Integer() uid = fields.UUID()
class BaseSchema(Schema): utc_time = fields.LocalDateTime() machine_time = custom_fields.UTCDateTime() type = custom_fields.ClassName() meta_type = fields.String() description = custom_fields.Unicode() line_no = fields.Integer() category = fields.String() def load(self, *args, **kwargs): raise NotImplementedError("Only serialization is supported.")