Make paginate_by adaptable

This commit is contained in:
Kumi 2022-09-26 11:39:52 +00:00
parent 99e6e9392a
commit 169a6c44a6
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -129,12 +129,12 @@ class Adonis:
return result
def getRequirements(self, view):
def getRequirements(self, view, paginate_by=100):
requirements = []
pnum = 1
while True:
page = self.getCrewListView(view, pagination="True", paginate_by="100", page=str(pnum))
page = self.getCrewListView(view, pagination="True", paginate_by=str(paginate_by), page=str(pnum))
for record in json.loads(page["Result"]):
requirements.append((record["PIN"], record["Document code"]))