-
Notifications
You must be signed in to change notification settings - Fork 670
Iteration of results #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can use the From the README: for g in gl.Group(page=1, per_page=10):
print (g) |
@gpocentek Ok, I'd missed that, sorry. But doesn't that just add those as query parameters and build a URL based on them? The API Docs for Pagination specifically say,
|
The "automatic" pagination proposed by @jantman would be a great addition. There's no way to find out the max number of pages for a given resource |
python-gitlab Issue #63 - implement pagination for list()
Closing as this as been implemented in #64 . Thanks. |
I'm using GitLab CE 7.12.2, and trying to list users via the API. I have 162 users. After connecting to GitLab using python-gitlab 0.9.2 from PyPi (my connection is
self.conn
),self.conn.User()
returns a list with 20 items, a fraction of my users.The GitLab API documentation says that it paginates responses with a default of 20 results per response.
It appears that python-gitlab is ignoring the pagination. The only use of the "page" response attribute that I see in the source code is on line 341 where it's deleted before passing to the constructor.
Could you please either implement pagination of responses so python-gitlab doesn't silently ignore results, or at least mention in the docs that this is happening?
Thanks.
The text was updated successfully, but these errors were encountered: