Esempio n. 1
0
class Pet(models.Base):
    id = IntField()
    category = EmbeddedField(Category)
    name = StringField()
    photo_urls = ListField(str)
    tags = ListField(Tag)
    status = StringField()
Esempio n. 2
0
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
Esempio n. 3
0
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))
Esempio n. 4
0
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
Esempio n. 5
0
class GetSupportedModesResponse(Base):
    basic = EmbeddedField(BasicMode)
    server_errors = EmbeddedField(ServerErrors)
    sso = DictField([str, type(None)])
    sso_providers = ListField([dict])
Esempio n. 6
0
class DebugImageEventsScrollState(Base, JsonSerializableMixin):
    id: str = StringField(required=True)
    metrics: Sequence[MetricScrollState] = ListField([MetricScrollState])
Esempio n. 7
0
class NullableListField(Base):
    field = ListField([str], nullable=True)
Esempio n. 8
0
class DebugImageEventsScrollState(Base, JsonSerializableMixin):
    id: str = StringField(required=True)
    tasks: Sequence[TaskScrollState] = ListField([TaskScrollState])
    warning: str = StringField()
Esempio n. 9
0
class MetricState(Base):
    metric: str = StringField(required=True)
    variants: Sequence[VariantState] = ListField([VariantState], required=True)
    timestamp: int = IntField(default=0)