From 4a2966e1b46e9db700837ac593d05c7098d95881 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 17 2015 11:54:20 +0000 Subject: Add method in the internal API to retrieve the comment of an issue based on its identifier --- diff --git a/progit/lib/__init__.py b/progit/lib/__init__.py index 400ee66..2777ca3 100644 --- a/progit/lib/__init__.py +++ b/progit/lib/__init__.py @@ -825,6 +825,20 @@ def get_issue_statuses(session): return output +def get_issue_comment(session, issue_uid, comment_id): + ''' Return a specific comment of a specified issue. + ''' + query = session.query( + model.IssueComment + ).filter( + model.IssueComment.issue_uid == issue_uid + ).filter( + model.IssueComment.id == comment_id + ) + + return query.first() + + def set_up_user(session, username, fullname, user_email): ''' Set up a new user into the database or update its information. ''' user = search_user(session, username=username)