summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorRoger Meier <r.meier@siemens.com>2020-02-25 12:31:32 +0100
committerGitHub <noreply@github.com>2020-02-25 12:31:32 +0100
commit3aa9873c8e5f38c85f7ac4dd11a21728e553399b (patch)
treec65c601e30dfa08298e1aa9c236188df02eb278b /gitlab
parent745bdf7caeffa907bb0594b602194f41d3a75e3e (diff)
parent16098244ad7c19867495cf4f0fda0c83fe54cd2b (diff)
downloadgitlab-3aa9873c8e5f38c85f7ac4dd11a21728e553399b.tar.gz
Merge pull request #1003 from python-gitlab/feat/all-keyset-pagination
feat: use keyset pagination by default for `all=True`
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index 32aa265..96a3c13 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -640,6 +640,12 @@ class Gitlab(object):
get_all = kwargs.pop("all", False)
url = self._build_url(path)
+ # use keyset pagination automatically, if all=True
+ order_by = kwargs.get("order_by")
+ if get_all and (not order_by or order_by == "id"):
+ kwargs["pagination"] = "keyset"
+ kwargs["order_by"] = "id"
+
if get_all is True and as_list is True:
return list(GitlabList(self, url, query_data, **kwargs))