class EntityBaseValidator(colander.MappingSchema): author = colander.SchemaNode(AccountRef()) project = colander.SchemaNode(ProjectRef()) status = colander.SchemaNode(colander.Integer(), default=20, missing=20, validator=colander.Range(0, 100))
class FileValidator(colander.MappingSchema): author = colander.SchemaNode(AccountRef()) project = colander.SchemaNode(ProjectRef()) file_name = colander.SchemaNode(colander.String(), validator=colander.Length(min=3)) mime_type = colander.SchemaNode(colander.String(), validator=colander.Length(min=3))
class ProjectValidator(colander.MappingSchema): slug = colander.SchemaNode(colander.String(), validator=colander.All( database_name, same_project)) label = colander.SchemaNode(colander.String(), validator=colander.Length(min=3)) author = colander.SchemaNode(AccountRef()) settings = colander.SchemaNode(colander.Mapping(), missing={})
class EntityBaseValidator(colander.MappingSchema): author = colander.SchemaNode(AccountRef()) project = colander.SchemaNode(ProjectRef())
class PermissionValidator(colander.MappingSchema): project = colander.SchemaNode(ProjectRef()) account = colander.SchemaNode(AccountRef()) reader = colander.SchemaNode(colander.Boolean(), missing=False) editor = colander.SchemaNode(colander.Boolean(), missing=False) admin = colander.SchemaNode(colander.Boolean(), missing=False)