From: Torsten Werner Date: Sun, 16 Jan 2011 17:22:00 +0000 (+0100) Subject: Refactor get_architecture_suites(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=775db71739073cdcf99fd6a2f68883f1d0de1610;p=dak Refactor get_architecture_suites(). Signed-off-by: Torsten Werner --- 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')