Example #1
0
class PaginationFlaskResty(GenericModelView):
    model = Article
    schema = ArticleSchema(many=True)
    pagination = PagePagination(page_size=5)

    def get(self):
        return self.list()
Example #2
0
    class PageWidgetListView(WidgetViewBase):
        pagination = PagePagination(2)

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

        def post(self):
            return self.create()
Example #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")
Example #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))
Example #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
Example #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
Example #7
0
 class PageWidgetListView(WidgetListViewBase):
     pagination = PagePagination(2)