class Pet(models.Base): id = IntField() category = EmbeddedField(Category) name = StringField() photo_urls = ListField(str) tags = ListField(Tag) status = StringField()
class TaskScrollState(Base): task: str = StringField(required=True) metrics: Sequence[MetricState] = ListField([MetricState], required=True) last_min_iter: Optional[int] = IntField() last_max_iter: Optional[int] = IntField() def reset(self): """Reset the scrolling state for the metric""" self.last_min_iter = self.last_max_iter = None
class DebugImageEventsScrollState(Base): id: str = StringField(required=True) metrics: Sequence[MetricScrollState] = ListField([MetricScrollState]) def to_json(self): return dumps(self.to_struct()) @classmethod def from_json(cls, s): return cls(**loads(s))
class MetricScrollState(Base): task: str = StringField(required=True) name: str = StringField(required=True) last_min_iter: Optional[int] = IntField() last_max_iter: Optional[int] = IntField() timestamp: int = IntField(default=0) variants: Sequence[VariantScrollState] = ListField([VariantScrollState]) def reset(self): """Reset the scrolling state for the metric""" self.last_min_iter = self.last_max_iter = None
class GetSupportedModesResponse(Base): basic = EmbeddedField(BasicMode) server_errors = EmbeddedField(ServerErrors) sso = DictField([str, type(None)]) sso_providers = ListField([dict])
class DebugImageEventsScrollState(Base, JsonSerializableMixin): id: str = StringField(required=True) metrics: Sequence[MetricScrollState] = ListField([MetricScrollState])
class NullableListField(Base): field = ListField([str], nullable=True)
class DebugImageEventsScrollState(Base, JsonSerializableMixin): id: str = StringField(required=True) tasks: Sequence[TaskScrollState] = ListField([TaskScrollState]) warning: str = StringField()
class MetricState(Base): metric: str = StringField(required=True) variants: Sequence[VariantState] = ListField([VariantState], required=True) timestamp: int = IntField(default=0)