Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit68d15fd

Browse files
author
Gauvain Pocentek
committed
Make GroupProject more "python-gitlabish"
1 parent69e64a3 commit68d15fd

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

‎gitlab/objects.py

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -666,14 +666,29 @@ class GroupMemberManager(BaseManager):
666666
obj_cls=GroupMember
667667

668668

669+
classGroupProject(GitlabObject):
670+
_url='/groups/%(group_id)s/projects'
671+
canGet='from_list'
672+
canCreate=False
673+
canDelete=False
674+
canUpdate=False
675+
optionalListAttrs= ['archived','visibility','order_by','sort',
676+
'search','ci_enabled_first']
677+
678+
679+
classGroupProjectManager(BaseManager):
680+
obj_cls=GroupProject
681+
682+
669683
classGroup(GitlabObject):
670684
_url='/groups'
671685
canUpdate=False
672686
_constructorTypes= {'projects':'Project'}
673687
requiredCreateAttrs= ['name','path']
674688
optionalCreateAttrs= ['description','visibility_level']
675689
shortPrintAttr='name'
676-
managers= [('members',GroupMemberManager, [('group_id','id')])]
690+
managers= [('members',GroupMemberManager, [('group_id','id')]),
691+
('projects',GroupProjectManager, [('group_id','id')])]
677692

678693
GUEST_ACCESS=10
679694
REPORTER_ACCESS=20
@@ -725,24 +740,6 @@ def search(self, query, **kwargs):
725740
returnself.gitlab._raw_list(url,self.obj_cls,**kwargs)
726741

727742

728-
classGroupProject(GitlabObject):
729-
deflist_projects(self,gid,**kwargs):
730-
"""List projects in a group
731-
732-
Attrs:
733-
gid (int): ID of the group
734-
735-
Returns:
736-
list(Group): a list of projects in the group
737-
"""
738-
url='/groups/%d/projects'%gid
739-
returnself.gitlab._raw_list(url,self.obj_cls,**kwargs)
740-
741-
742-
classGroupProjectManager(BaseManager):
743-
obj_cls=GroupProject
744-
745-
746743
classHook(GitlabObject):
747744
_url='/hooks'
748745
canUpdate=False

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp