diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 22:12:02 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-05-23 22:12:05 +0200 |
commit | e789cee1cd619e9e1b2358915936bccc876879ad (patch) | |
tree | fe77104cd118c2be6a409791c963ac102db38b96 /gitlab/v4/objects.py | |
parent | 6684c13a4f98b4c4b7c8a6af1957711d7cc0ae2b (diff) | |
download | gitlab-e789cee1cd619e9e1b2358915936bccc876879ad.tar.gz |
[v4] Add projects.list() attributes
All the ProjectManager filter methods can now be handled by
projects.list().
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r-- | gitlab/v4/objects.py | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index c38b115..f38b60b 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1776,7 +1776,9 @@ class Project(GitlabObject): _constructorTypes = {'owner': 'User', 'namespace': 'Group'} optionalListAttrs = ['search'] requiredCreateAttrs = ['name'] - optionalListAttrs = ['search'] + optionalListAttrs = ['search', 'owned', 'starred', 'archived', + 'visibility', 'order_by', 'sort', 'simple', + 'membership', 'statistics'] optionalCreateAttrs = ['path', 'namespace_id', 'description', 'issues_enabled', 'merge_requests_enabled', 'builds_enabled', 'wiki_enabled', @@ -2167,42 +2169,6 @@ class TodoManager(BaseManager): class ProjectManager(BaseManager): obj_cls = Project - def all(self, **kwargs): - """List all the projects (need admin rights). - - Args: - all (bool): If True, return all the items, without pagination - **kwargs: Additional arguments to send to GitLab. - - Returns: - list(gitlab.Gitlab.Project): The list of projects. - """ - return self.gitlab._raw_list("/projects/all", Project, **kwargs) - - def owned(self, **kwargs): - """List owned projects. - - Args: - all (bool): If True, return all the items, without pagination - **kwargs: Additional arguments to send to GitLab. - - Returns: - list(gitlab.Gitlab.Project): The list of owned projects. - """ - return self.gitlab._raw_list("/projects/owned", Project, **kwargs) - - def starred(self, **kwargs): - """List starred projects. - - Args: - all (bool): If True, return all the items, without pagination - **kwargs: Additional arguments to send to GitLab. - - Returns: - list(gitlab.Gitlab.Project): The list of starred projects. - """ - return self.gitlab._raw_list("/projects/starred", Project, **kwargs) - class GroupProject(Project): _url = '/groups/%(group_id)s/projects' |