Ejemplo n.º 1
0
class PublicUserOutSchema(Schema):
    id = Integer()
    username = String()
    name = String()
    location = String()
    about_me = String()
    confirmed = Boolean()
    blocked = Boolean()
    member_since = DateTime()
    last_seen = DateTime()
    self = ma.URLFor(".user", values=dict(user_id="<id>"))
Ejemplo n.º 2
0
class AlumnoInSchema(Schema):
    nombre = String(required=True, validate=Length(min=2, max=50))
    primer_apellido = String(required=True, validate=Length(min=2, max=50))
    segundo_apellido = String(required=False, validate=Length(min=2, max=50))
    carrera = String(required=True, validate=OneOf(carreras))
    semestre = Integer(required=True, validate=Range(min=1, max=50))
    promedio = Float(required=True, validate=Range(min=0, max=10))
    al_corriente = Boolean(required=True)
Ejemplo n.º 3
0
class PostOutSchema(Schema):
    id = Integer()
    title = String()
    content = String()
    coins = Integer()
    private = Boolean()
    author = Nested(PublicUserOutSchema)
    comments = List(Nested(CommentOutSchema, exclude=("post", )))
    columns = List(Nested(ColumnOutSchema, exclude=("posts", "author")))
    self = ma.URLFor(".post", values=dict(post_id="<id>"))
Ejemplo n.º 4
0
class VerifyTokenOutSchema(Schema):
    username = String()
    valid = Boolean()
Ejemplo n.º 5
0
class GroupOutSchema(Schema):
    name = String()
    members = List(Nested(PublicUserOutSchema))
    manager = Nested(PublicUserOutSchema)
    private = Boolean()
Ejemplo n.º 6
0
class GroupInSchema(Schema):
    name = String(required=True)
    members = List(Integer())
    private = Boolean()
Ejemplo n.º 7
0
class PostInSchema(Schema):
    title = String(required=True)
    content = String(required=True)
    private = Boolean(default=False)
    column_ids = List(Integer())