예제 #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
 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))