From 8deb8d5bc65405f37eca5fa9e101189ceb6547af Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Sat, 2 May 2009 17:00:14 +0100 Subject: [PATCH] allow listing all s-a/a combinations and add a backref to make it easier Signed-off-by: Mark Hymers --- dak/admin.py | 11 ++++++++++- daklib/dbconn.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dak/admin.py b/dak/admin.py index 1cf80f28..0f99bafc 100755 --- a/dak/admin.py +++ b/dak/admin.py @@ -151,6 +151,13 @@ dispatch['a'] = architecture ################################################################################ +def __suite_architecture_list(d, args): + s = d.session() + suites = s.query(Suite).all() + for j in s.query(Suite).order_by('suite_name').all(): + print j.suite_name + ' ' + \ + ','.join([a.architecture.arch_string for a in j.suitearchitectures]) + def __suite_architecture_listarch(d, args): die_arglen(args, 3, "E: suite-architecture list-arch requires a suite") a = get_suite_architectures(args[2].lower()) @@ -222,7 +229,9 @@ def suite_architecture(command): mode = args[1].lower() - if mode == 'list-arch': + if mode == 'list': + __suite_architecture_list(d, args) + elif mode == 'list-arch': __suite_architecture_listarch(d, args) elif mode == 'list-suite': __suite_architecture_listsuite(d, args) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 32fbdb55..a9d4d4a7 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -1159,7 +1159,7 @@ class DBConn(Singleton): mapper(SuiteArchitecture, self.tbl_suite_architectures, properties = dict(suite_id = self.tbl_suite_architectures.c.suite, - suite = relation(Suite), + suite = relation(Suite, backref='suitearchitectures'), arch_id = self.tbl_suite_architectures.c.architecture, architecture = relation(Architecture))) -- 2.39.5