8000 Update groups.rst by rnelson01 · Pull Request #3095 · python-gitlab/python-gitlab · GitHub
[go: up one dir, main page]

Skip to content

Update groups.rst #3095

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/gl_objects/groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,15 @@ ancestor groups)::

members = group.members_all.list(get_all=True)

List all groups and all group member with access level::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it's covering a bit more than just the group members API and almost like a small cookbook example. WDYT about narrowing it down to just the API calls for members, or moving this example to a separate documentation page for longer examples?


groups = gl.groups.list(get_all=True)
for group in groups:
members = group.members_all.list(get_all=True)
for member in members:
gh = group.members_all.get(member.id)
print(group.id, group.name, gh.name, gh.username,gh.access_level)

Get only direct group member::

members = group.members.get(member_id)
Expand Down
Loading
0