From: Mark Hymers Date: Thu, 28 Jul 2011 06:37:16 +0000 (+0100) Subject: Add get_component_names routine X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b183dd4654f707cb68584c055a498b718f3b0b74;p=dak.git Add get_component_names routine Signed-off-by: Mark Hymers --- 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):