Exemplo n.º 1
0
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))
Exemplo n.º 2
0
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))
Exemplo n.º 3
0
 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={})
Exemplo n.º 4
0
class EntityBaseValidator(colander.MappingSchema):
    author = colander.SchemaNode(AccountRef())
    project = colander.SchemaNode(ProjectRef())
Exemplo n.º 5
0
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)