From 8f2bb5b39956e088a5456a8aa0052e2c4fc04a10 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 30 Dec 2017 16:15:56 +0100 Subject: [PATCH] Add page_size parameter --- taiga/models/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/taiga/models/base.py b/taiga/models/base.py index 0cbbc72..28d56a2 100644 --- a/taiga/models/base.py +++ b/taiga/models/base.py @@ -34,9 +34,12 @@ def __init__(self, requester): class ListResource(Resource): - def list(self, lazy_pagination=False, all=True, **queryparams): + def list(self, lazy_pagination=False, page_size=100, all=False, + **queryparams): + if page_size and not all: + queryparams['page_size'] = page_size result = self.requester.get( - self.instance.endpoint, query=queryparams, paginate=all + self.instance.endpoint, query=queryparams, paginate=not all ) objects = SearchableList() objects.extend(self.parse_list(result.json()))