コード例 #1
0
def page_number(page: http.QueryParam, page_size: http.QueryParam,
                count: http.QueryParam) -> typing.List[int]:
    params = {"page": page, "page_size": page_size, "content": list(range(25))}
    if count in ("0", 0, "False", "false", False):
        params["count"] = False

    return PageNumberResponse(**params)
コード例 #2
0
ファイル: peewee.py プロジェクト: perdy/apistar-crud
 def list_(
         cls,
         page: http.QueryParam = None,
         page_size: http.QueryParam = None) -> typing.List[output_type]:
     """
     List resource collection.
     """
     return PageNumberResponse(page=page,
                               page_size=page_size,
                               content=cls._filter())  # noqa
コード例 #3
0
 def list(cls, name: http.QueryParam, page: http.QueryParam,
          page_size: http.QueryParam) -> typing.List[PuppyOutputType]:
     return PageNumberResponse(content=cls._filter(name=name),
                               page=page,
                               page_size=page_size)
コード例 #4
0
 def list(
     cls, session: Session, page: http.QueryParam, page_size: http.QueryParam, name: http.QueryParam
 ) -> typing.List[PuppyOutputType]:
     return PageNumberResponse(page=page, page_size=page_size, content=cls._filter(session=session, name=name))