-
Notifications
You must be signed in to change notification settings - Fork 436
Updates to Group Documentation and user pagination options #142
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chris!
Glad to see you contributing!
You'll need to sign the CLA as well, is that in progress?
if not group_item.id: | ||
error = "Group item missing ID. Group must be retrieved from server first." | ||
raise MissingRequiredFieldError(error) | ||
url = "{0}/{1}/users".format(self.baseurl, group_item.id) | ||
url = "{0}/{1}/users?pageSize={2}".format(self.baseurl, group_item.id,page_size) | ||
server_response = self.get_request(url, req_options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will, sadly, still fail for cases where groups have more than the max page size, which is 1000.
I haven't reviewed this part of the design recently, but we need a way to either:
- Make
Pager
work with populating group calls or - Make this user
Pager 10000 code> under the covers.
/cc @RussTheAerialist
I'll have some time later this week to think about it in detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will fail - but so will the standard API call. Moving to Pager
would be very helpful.
docs/docs/api-ref.md
Outdated
``` | ||
groups = server.groups.get() | ||
``` | ||
Returns two objects - the groups and the pagination item. To access info about groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preferred way to show this would be:
groups, _ = server.groups.get()
Instead of indexing the 2-tuple
docs/docs/api-ref.md
Outdated
The group object contains the same information as the standard XML from REST API. For Sites with more than one group, you can access each individual group like this. | ||
|
||
``` | ||
#To see the attributes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically true, but not really scl
related, I would this out
docs/docs/api-ref.md
Outdated
#To see the attributes | ||
dir(group_list[i]) | ||
|
||
#use these attributes (domain_name, id, name, users) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this isn't doc'd yet (which I'm sure it isn't?) can you list out the group class and it's attributes with a brief one-liner.
OR, if you'd like, submit a docstring for those classes first, and then update the docs?
CLA Request submitted - @t8y8 updates pushed per your comments in the meantime. |
@cmtoomey I think I came up with a way to make this use But it's got 4 parts to it:
|
Per #141, adding a pagination object to groups.populate_users solved the problem. There is still no way to know how many users are in a group, without actually running populate_users and pulling total_available.
I also added documentation so others will be able to walk through group interaction.