diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-01-27 16:52:16 +0100 |
---|---|---|
committer | Max Wittig <max.wittig@siemens.com> | 2020-01-27 16:52:16 +0100 |
commit | 99b4484da924f9378518a1a1194e1a3e75b48073 (patch) | |
tree | d6fc66d3ef6a943061f3ca0af8b8e9c17fa91b2b /gitlab | |
parent | 7843ace913589cf629f448a2541f290a4c7214cd (diff) | |
download | gitlab-99b4484da924f9378518a1a1194e1a3e75b48073.tar.gz |
feat: use keyset pagination by default for `all=True`
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index c9716c2..b4adacf 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)) |