diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-08-11 10:58:40 +0200 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-08-11 10:58:40 +0200 |
| commit | 131739f492946ba1cd58852be1caf000af451384 (patch) | |
| tree | e0fc7e848fc93f90e6fcad8685a5eff18547dd29 /docs/gl_objects | |
| parent | 3e026d2ee62eba3ad92ff2cdd53db19f5e0e9f6a (diff) | |
| download | gitlab-131739f492946ba1cd58852be1caf000af451384.tar.gz | |
implement the todo API
Diffstat (limited to 'docs/gl_objects')
| -rw-r--r-- | docs/gl_objects/issues.py | 4 | ||||
| -rw-r--r-- | docs/gl_objects/issues.rst | 6 | ||||
| -rw-r--r-- | docs/gl_objects/mrs.py | 4 | ||||
| -rw-r--r-- | docs/gl_objects/mrs.rst | 6 | ||||
| -rw-r--r-- | docs/gl_objects/todos.py | 22 | ||||
| -rw-r--r-- | docs/gl_objects/todos.rst | 48 |
6 files changed, 90 insertions, 0 deletions
diff --git a/docs/gl_objects/issues.py b/docs/gl_objects/issues.py index a378910..ad48dc8 100644 --- a/docs/gl_objects/issues.py +++ b/docs/gl_objects/issues.py @@ -73,3 +73,7 @@ issue.unsubscribe() # project issue move issue.move(new_project_id) # end project issue move + +# project issue todo +issue.todo() +# end project issue todo diff --git a/docs/gl_objects/issues.rst b/docs/gl_objects/issues.rst index ac23043..d4cbf00 100644 --- a/docs/gl_objects/issues.rst +++ b/docs/gl_objects/issues.rst @@ -98,3 +98,9 @@ Move an issue to another project: .. literalinclude:: issues.py :start-after: # project issue move :end-before: # end project issue move + +Make an issue as todo: + +.. literalinclude:: issues.py + :start-after: # project issue todo + :end-before: # end project issue todo diff --git a/docs/gl_objects/mrs.py b/docs/gl_objects/mrs.py index 1309923..0ef3b87 100644 --- a/docs/gl_objects/mrs.py +++ b/docs/gl_objects/mrs.py @@ -59,3 +59,7 @@ mr.closes_issues() mr.subscribe() mr.unsubscribe() # end subscribe + +# todo +mr.todo() +# end todo diff --git a/docs/gl_objects/mrs.rst b/docs/gl_objects/mrs.rst index 2def079..6c83ab7 100644 --- a/docs/gl_objects/mrs.rst +++ b/docs/gl_objects/mrs.rst @@ -83,3 +83,9 @@ Subscribe/unsubscribe a MR: .. literalinclude:: mrs.py :start-after: # subscribe :end-before: # end subscribe + +Mark a MR as todo: + +.. literalinclude:: mrs.py + :start-after: # todo + :end-before: # end todo diff --git a/docs/gl_objects/todos.py b/docs/gl_objects/todos.py new file mode 100644 index 0000000..74ec211 --- /dev/null +++ b/docs/gl_objects/todos.py @@ -0,0 +1,22 @@ +# list +todos = gl.todos.list() +# end list + +# filter +todos = gl.todos.list(project_id=1) +todos = gl.todos.list(state='done', type='Issue') +# end filter + +# get +todo = gl.todos.get(todo_id) +# end get + +# delete +gl.todos.delete(todo_id) +# or +todo.delete() +# end delete + +# all_delete +nb_of_closed_todos = gl.todos.delete_all() +# end all_delete diff --git a/docs/gl_objects/todos.rst b/docs/gl_objects/todos.rst new file mode 100644 index 0000000..bd7f1fa --- /dev/null +++ b/docs/gl_objects/todos.rst @@ -0,0 +1,48 @@ +##### +Todos +##### + +Use :class:`~gitlab.objects.Todo` objects to manipulate todos. The +:attr:`gitlab.Gitlab.todos` manager object provides helper functions. + +Examples +-------- + +List active todos: + +.. literalinclude:: todos.py + :start-after: # list + :end-before: # end list + +You can filter the list using the following parameters: + +* ``action``: can be ``assigned``, ``mentioned``, ``build_failed``, ``marked``, + or ``approval_required`` +* ``author_id`` +* ``project_id`` +* ``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: + +.. literalinclude:: todos.py + :start-after: # get + :end-before: # end get + +Mark a todo as done: + +.. literalinclude:: todos.py + :start-after: # delete + :end-before: # end delete + +Mark all the todos as done: + +.. literalinclude:: todos.py + :start-after: # all_delete + :end-before: # end all_delete |
