From 8efc303190354144ab9d9bcd88b5f829833d64ad Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 25 2014 10:08:19 +0000 Subject: Add to the internal API a method to retrieve the tags of a project --- diff --git a/progit/lib.py b/progit/lib.py index 1c4eb76..2a3e261 100644 --- a/progit/lib.py +++ b/progit/lib.py @@ -641,6 +641,24 @@ def get_issue(session, projectid, issueid): return query.first() +def get_tags_of_project(session, project): + ''' Returns the list of tags associated with the issues of a project. + ''' + query = session.query( + model.Tag + ).filter( + model.Tag.tag == model.TagIssue.tag + ).filter( + model.TagIssue.issue_id == model.Issue.id + ).filter( + model.Issue.project_id == project.id + ).order_by( + model.Tag.tag + ) + + return query.all() + + def get_pull_requests( session, project_id=None, project_id_from=None, status=None):