예제 #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))
예제 #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))
예제 #3
0
파일: projects.py 프로젝트: eocaollai/grano
 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={})
예제 #4
0
class EntityBaseValidator(colander.MappingSchema):
    author = colander.SchemaNode(AccountRef())
    project = colander.SchemaNode(ProjectRef())
예제 #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)