summaryrefslogtreecommitdiff
path: root/gitlab/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 19:44:12 +0100
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-23 19:44:12 +0100
commitdb1fb89d70feee8ef45876ec8ac5f9ccf69457a5 (patch)
tree3f431551f18c61f4694ea20cf4730d496d0200f0 /gitlab/objects.py
parent1ecb7399ad2fb469781068208f787818aa52eec2 (diff)
downloadgitlab-db1fb89d70feee8ef45876ec8ac5f9ccf69457a5.tar.gz
Implement ProjectMilestone.issues()
This lists the issues related to the milestone. Add python API tests for issues.
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r--gitlab/objects.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 5ae1fb3..70c1286 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -891,6 +891,19 @@ class ProjectMilestone(GitlabObject):
optionalCreateAttrs = ['description', 'due_date', 'state_event']
shortPrintAttr = 'title'
+ def issues(self):
+ url = "/projects/%s/milestones/%s/issues" % (self.project_id, self.id)
+ r = self.gitlab._raw_get(url)
+ raise_error_from_response(r, GitlabDeleteError)
+
+ l = []
+ for j in r.json():
+ o = ProjectIssue(self, j)
+ o._from_api = True
+ l.append(o)
+
+ return l
+
class ProjectMilestoneManager(BaseManager):
obj_cls = ProjectMilestone