From b183dd4654f707cb68584c055a498b718f3b0b74 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Thu, 28 Jul 2011 07:37:16 +0100 Subject: [PATCH] Add get_component_names routine Signed-off-by: Mark Hymers --- daklib/dbconn.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 25398981..e88911c5 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1132,6 +1132,19 @@ def get_component(component, session=None): __all__.append('get_component') +@session_wrapper +def get_component_names(session=None): + """ + Returns list of strings of component names. + + @rtype: list + @return: list of strings of component names + """ + + return [ x.component_name for x in session.query(Component).all() ] + +__all__.append('get_component_names') + ################################################################################ class DBConfig(object): -- 2.39.5