From 2e810e16a4774d3edf8526ee3d96d3323f09b6d7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 01 2015 18:29:30 +0000 Subject: Add a method to the internal API to retrieve a tag object based on its value --- diff --git a/progit/lib.py b/progit/lib.py index 11f3249..b844150 100644 --- a/progit/lib.py +++ b/progit/lib.py @@ -683,6 +683,17 @@ def get_tags_of_project(session, project): return query.all() +def get_tag(session, tag): + ''' Returns a Tag object for the given tag text. + ''' + query = session.query( + model.Tag + ).filter( + model.Tag.tag == tag + ) + + return query.first() + def get_pull_requests( session, project_id=None, project_id_from=None, status=None):