]> err.no Git - dak/commitdiff
Refactor get_architecture_suites().
authorTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 17:22:00 +0000 (18:22 +0100)
committerTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 17:22:00 +0000 (18:22 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/dbconn.py

index c4d4aff672dd3a07030fbef9de90b3fdbe10cee7..78fb8f0ae6b33ddafc9af54b99edf3928e2acb22 100755 (executable)
@@ -193,6 +193,7 @@ def get_architecture(architecture, session=None):
 
 __all__.append('get_architecture')
 
+# TODO: should be removed because the implementation is too trivial
 @session_wrapper
 def get_architecture_suites(architecture, session=None):
     """
@@ -209,13 +210,7 @@ def get_architecture_suites(architecture, session=None):
     @return: list of Suite objects for the given name (may be empty)
     """
 
-    q = session.query(Suite)
-    q = q.join(SuiteArchitecture)
-    q = q.join(Architecture).filter_by(arch_string=architecture).order_by('suite_name')
-
-    ret = q.all()
-
-    return ret
+    return get_architecture(architecture, session).suites
 
 __all__.append('get_architecture_suites')