Esempio n. 1
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>"))
Esempio n. 2
0
class CommentOutSchema(Schema):
    id = Integer()
    body = String()
    author = Nested(PublicUserOutSchema)
    post = Nested(lambda: PostOutSchema(only=(
        "id",
        "title",
        "self",
    )))
    replying = Nested(lambda: CommentOutSchema(exclude=("replying", )))
    self = ma.URLFor(".comment", values=dict(comment_id="<id>"))
Esempio n. 3
0
class PetsOutSchema(Schema):
    pets = List(Nested(PetOutSchema))
    pagination = Nested(PaginationSchema)
Esempio n. 4
0
class GroupOutSchema(Schema):
    name = String()
    members = List(Nested(PublicUserOutSchema))
    manager = Nested(PublicUserOutSchema)
    private = Boolean()
Esempio n. 5
0
class NotificationOutSchema(Schema):
    id = Integer()
    message = String()
    receiver = Nested(PublicUserOutSchema)
    timestamp = DateTime()
Esempio n. 6
0
class ColumnOutSchema(Schema):
    id = Integer()
    name = String()
    author = Nested(PublicUserOutSchema)
    posts = List(Nested(lambda: PostOutSchema(only=("id", "title", "self"))))
    self = ma.URLFor(".column", values=dict(column_id="<id>"))