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

Commite789cee

Browse files
author
Gauvain Pocentek
committed
[v4] Add projects.list() attributes
All the ProjectManager filter methods can now be handled byprojects.list().
1 parent6684c13 commite789cee

File tree

1 file changed

+3
-37
lines changed

1 file changed

+3
-37
lines changed

‎gitlab/v4/objects.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,9 @@ class Project(GitlabObject):
17761776
_constructorTypes= {'owner':'User','namespace':'Group'}
17771777
optionalListAttrs= ['search']
17781778
requiredCreateAttrs= ['name']
1779-
optionalListAttrs= ['search']
1779+
optionalListAttrs= ['search','owned','starred','archived',
1780+
'visibility','order_by','sort','simple',
1781+
'membership','statistics']
17801782
optionalCreateAttrs= ['path','namespace_id','description',
17811783
'issues_enabled','merge_requests_enabled',
17821784
'builds_enabled','wiki_enabled',
@@ -2167,42 +2169,6 @@ def delete_all(self, **kwargs):
21672169
classProjectManager(BaseManager):
21682170
obj_cls=Project
21692171

2170-
defall(self,**kwargs):
2171-
"""List all the projects (need admin rights).
2172-
2173-
Args:
2174-
all (bool): If True, return all the items, without pagination
2175-
**kwargs: Additional arguments to send to GitLab.
2176-
2177-
Returns:
2178-
list(gitlab.Gitlab.Project): The list of projects.
2179-
"""
2180-
returnself.gitlab._raw_list("/projects/all",Project,**kwargs)
2181-
2182-
defowned(self,**kwargs):
2183-
"""List owned projects.
2184-
2185-
Args:
2186-
all (bool): If True, return all the items, without pagination
2187-
**kwargs: Additional arguments to send to GitLab.
2188-
2189-
Returns:
2190-
list(gitlab.Gitlab.Project): The list of owned projects.
2191-
"""
2192-
returnself.gitlab._raw_list("/projects/owned",Project,**kwargs)
2193-
2194-
defstarred(self,**kwargs):
2195-
"""List starred projects.
2196-
2197-
Args:
2198-
all (bool): If True, return all the items, without pagination
2199-
**kwargs: Additional arguments to send to GitLab.
2200-
2201-
Returns:
2202-
list(gitlab.Gitlab.Project): The list of starred projects.
2203-
"""
2204-
returnself.gitlab._raw_list("/projects/starred",Project,**kwargs)
2205-
22062172

22072173
classGroupProject(Project):
22082174
_url='/groups/%(group_id)s/projects'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp