]> git.decadent.org.uk Git - dak.git/commitdiff
Add get_component_names routine
authorMark Hymers <mhy@debian.org>
Thu, 28 Jul 2011 06:37:16 +0000 (07:37 +0100)
committerMark Hymers <mhy@debian.org>
Thu, 28 Jul 2011 06:37:16 +0000 (07:37 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
daklib/dbconn.py

index 25398981ffb83912c5e1603da961860a38f9d087..e88911c5109201ab597cd3f2ca9aba0a75dfdd6e 100755 (executable)
@@ -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):