Ejemplo n.º 1
0
class PaginationFlaskResty(GenericModelView):
    model = Article
    schema = ArticleSchema(many=True)
    pagination = PagePagination(page_size=5)

    def get(self):
        return self.list()
Ejemplo n.º 2
0
    class PageWidgetListView(WidgetViewBase):
        pagination = PagePagination(2)

        def get(self):
            return self.list()

        def post(self):
            return self.create()
Ejemplo n.º 3
0
class AuthorViewBase(GenericModelView):
    model = models.Author
    schema = schemas.AuthorSchema()

    authentication = NoOpAuthentication()
    authorization = NoOpAuthorization()

    pagination = PagePagination(page_size=10)
    sorting = Sorting("created_at", default="-created_at")
Ejemplo n.º 4
0
class BookViewBase(GenericModelView):
    model = models.Book
    schema = schemas.BookSchema()

    authentication = NoOpAuthentication()
    authorization = NoOpAuthorization()

    pagination = PagePagination(page_size=10)
    sorting = Sorting("published_at", default="-published_at")
    filtering = Filtering(author_id=ColumnFilter(operator.eq, required=True))
Ejemplo n.º 5
0
    class FooListView(FooViewBase):
        spec_declaration = ModelViewDeclaration(many=True)

        filtering = Filtering(color=operator.eq, )
        sorting = Sorting('name', 'color')
        pagination = PagePagination(2)

        def get(self):
            pass

        def post(self):
            """test the docstring"""
            pass
Ejemplo n.º 6
0
    class FooListView(GenericModelView):
        schema = schemas['foo']()

        spec_declaration = ModelViewDeclaration(many=True)

        filtering = Filtering(color=operator.eq, )
        sorting = Sorting('name', 'color')
        pagination = PagePagination(2)

        def get(self):
            pass

        def post(self):
            """test the docstring"""
            pass
Ejemplo n.º 7
0
 class PageWidgetListView(WidgetListViewBase):
     pagination = PagePagination(2)