summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/api-usage.rst19
-rw-r--r--docs/gl_objects/commits.rst8
-rw-r--r--docs/gl_objects/users.rst4
3 files changed, 30 insertions, 1 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index a5afbda..8ab252c 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -118,6 +118,25 @@ Some objects also provide managers to access related GitLab resources:
project = gl.projects.get(1)
issues = project.issues.list()
+python-gitlab allows to send any data to the GitLab server when making queries.
+In case of invalid or missing arguments python-gitlab will raise an exception
+with the GitLab server error message:
+
+.. code-block:: python
+
+ >>> gl.projects.list(sort='invalid value')
+ ...
+ GitlabListError: 400: sort does not have a valid value
+
+You can use the ``query_parameters`` argument to send arguments that would
+conflict with python or python-gitlab when using them as kwargs:
+
+.. code-block:: python
+
+ gl.user_activities.list(from='2019-01-01') ## invalid
+
+ gl.user_activities.list(query_parameters={'from': '2019-01-01'}) # OK
+
Gitlab Objects
==============
diff --git a/docs/gl_objects/commits.rst b/docs/gl_objects/commits.rst
index 662d9c3..9f48c98 100644
--- a/docs/gl_objects/commits.rst
+++ b/docs/gl_objects/commits.rst
@@ -27,6 +27,14 @@ results::
commits = project.commits.list(ref_name='my_branch')
commits = project.commits.list(since='2016-01-01T00:00:00Z')
+.. note::
+
+ The available ``all`` listing argument conflicts with the python-gitlab
+ argument. Use ``query_parameters`` to avoid the conflict::
+
+ commits = project.commits.list(all=True,
+ query_parameters={'ref_name': 'my_branch'})
+
Create a commit::
# See https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
diff --git a/docs/gl_objects/users.rst b/docs/gl_objects/users.rst
index d86d2ed..e66ef3a 100644
--- a/docs/gl_objects/users.rst
+++ b/docs/gl_objects/users.rst
@@ -312,4 +312,6 @@ Examples
Get the users activities::
- activities = gl.user_activities.list(all=True, as_list=False)
+ activities = gl.user_activities.list(
+ query_parameters={'from': '2018-07-01'},
+ all=True, as_list=False)