summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/gl_objects/projects.py2
-rw-r--r--gitlab/__init__.py4
-rw-r--r--gitlab/objects.py6
3 files changed, 11 insertions, 1 deletions
diff --git a/docs/gl_objects/projects.py b/docs/gl_objects/projects.py
index 8e5cb13..2f8d5b5 100644
--- a/docs/gl_objects/projects.py
+++ b/docs/gl_objects/projects.py
@@ -16,7 +16,7 @@ projects = gl.projects.starred()
projects = gl.projects.all()
# Search projects
-projects = gl.projects.list(search='query')
+projects = gl.projects.list(search='keyword')
# end list
# get
diff --git a/gitlab/__init__.py b/gitlab/__init__.py
index edefd89..19da2c7 100644
--- a/gitlab/__init__.py
+++ b/gitlab/__init__.py
@@ -126,6 +126,10 @@ class Gitlab(object):
manager = cls(self)
setattr(self, var_name, manager)
+ @property
+ def api_version(self):
+ return self._api_version
+
def _cls_to_manager_prefix(self, cls):
# Manage bad naming decisions
camel_case = (cls.__name__
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 0def183..630d415 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -2278,6 +2278,7 @@ class Project(GitlabObject):
_constructorTypes = {'owner': 'User', 'namespace': 'Group'}
optionalListAttrs = ['search']
requiredCreateAttrs = ['name']
+ optionalListAttrs = ['search']
optionalCreateAttrs = ['path', 'namespace_id', 'description',
'issues_enabled', 'merge_requests_enabled',
'builds_enabled', 'wiki_enabled',
@@ -2678,6 +2679,8 @@ class ProjectManager(BaseManager):
def search(self, query, **kwargs):
"""Search projects by name.
+ API v3 only.
+
.. note::
The search is only performed on the project name (not on the
@@ -2696,6 +2699,9 @@ class ProjectManager(BaseManager):
Returns:
list(gitlab.Gitlab.Project): A list of matching projects.
"""
+ if self.gitlab.api_version == '4':
+ raise NotImplementedError("Not supported by v4 API")
+
return self.gitlab._raw_list("/projects/search/" + query, Project,
**kwargs)