From 775db71739073cdcf99fd6a2f68883f1d0de1610 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Sun, 16 Jan 2011 18:22:00 +0100 Subject: [PATCH] Refactor get_architecture_suites(). Signed-off-by: Torsten Werner --- daklib/dbconn.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index c4d4aff6..78fb8f0a 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -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') -- 2.39.5