summaryrefslogtreecommitdiff
path: root/docs/gl_objects/todos.rst
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-05-20 09:01:05 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-05-20 09:01:05 +0200
commit5292ffb366f97e4dc611dfd49a1dca7d1e934f4c (patch)
tree220659b39e0e5384504de3c63bbff003ad50eec2 /docs/gl_objects/todos.rst
parent2c342372814bbac2203d7b4c0f2cd32541bab979 (diff)
downloadgitlab-5292ffb366f97e4dc611dfd49a1dca7d1e934f4c.tar.gz
[docs] Rework the examples pages
* Get rid of the .py files and bring all the python examples in the RST files * Fix a few things
Diffstat (limited to 'docs/gl_objects/todos.rst')
-rw-r--r--docs/gl_objects/todos.rst45
1 files changed, 21 insertions, 24 deletions
diff --git a/docs/gl_objects/todos.rst b/docs/gl_objects/todos.rst
index bd7f1fa..a01aa43 100644
--- a/docs/gl_objects/todos.rst
+++ b/docs/gl_objects/todos.rst
@@ -2,17 +2,23 @@
Todos
#####
-Use :class:`~gitlab.objects.Todo` objects to manipulate todos. The
-:attr:`gitlab.Gitlab.todos` manager object provides helper functions.
+Reference
+---------
+
+* v4 API:
+
+ + :class:`~gitlab.objects.Todo`
+ + :class:`~gitlab.objects.TodoManager`
+ + :attr:`gitlab.Gitlab.todos`
+
+* GitLab API: https://docs.gitlab.com/ce/api/todos.html
Examples
--------
-List active todos:
+List active todos::
-.. literalinclude:: todos.py
- :start-after: # list
- :end-before: # end list
+ todos = gl.todos.list()
You can filter the list using the following parameters:
@@ -23,26 +29,17 @@ You can filter the list using the following parameters:
* ``state``: can be ``pending`` or ``done``
* ``type``: can be ``Issue`` or ``MergeRequest``
-For example:
-
-.. literalinclude:: todos.py
- :start-after: # filter
- :end-before: # end filter
-
-Get a single todo:
+For example::
-.. literalinclude:: todos.py
- :start-after: # get
- :end-before: # end get
+ todos = gl.todos.list(project_id=1)
+ todos = gl.todos.list(state='done', type='Issue')
-Mark a todo as done:
+Mark a todo as done::
-.. literalinclude:: todos.py
- :start-after: # delete
- :end-before: # end delete
+ gl.todos.delete(todo_id)
+ # or
+ todo.delete()
-Mark all the todos as done:
+Mark all the todos as done::
-.. literalinclude:: todos.py
- :start-after: # all_delete
- :end-before: # end all_delete
+ nb_of_closed_todos = gl.todos.delete_all()