diff --git a/progit/lib.py b/progit/lib.py index 2a87583..75b1a2c 100644 --- a/progit/lib.py +++ b/progit/lib.py @@ -936,3 +936,20 @@ def get_groups(session): ) return query.all() + + +def get_group(session, group): + ''' Return a specific group for the specified group name. + + :arg session: the session with which to connect to the database. + + ''' + query = session.query( + model.ProgitGroup + ).filter( + model.ProgitGroup.group_name == group + ).order_by( + model.ProgitGroup.group_name + ) + + return query.first()