clearml-server/apiserver/apimodels/base.py

29 lines
725 B
Python
Raw Normal View History

2019-06-10 21:24:35 +00:00
from jsonmodels import models, fields
from jsonmodels.validators import Length
2019-06-10 21:24:35 +00:00
from apiserver.apimodels import MongoengineFieldsDict, ListField
2019-06-10 21:24:35 +00:00
class UpdateResponse(models.Base):
updated = fields.IntField(required=True)
fields = MongoengineFieldsDict()
class PagedRequest(models.Base):
page = fields.IntField()
page_size = fields.IntField()
2019-12-29 07:03:19 +00:00
class IdResponse(models.Base):
id = fields.StringField(required=True)
class MakePublicRequest(models.Base):
ids = ListField(items_types=str, validators=[Length(minimum_value=1)])
class MoveRequest(models.Base):
ids = ListField([str], validators=Length(minimum_value=1))
project = fields.StringField()
project_name = fields.StringField()