summaryrefslogtreecommitdiff
path: root/docs/gl_objects/todos.rst
diff options
context:
space:
mode:
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()