]> git.decadent.org.uk Git - dak.git/commitdiff
allow listing all s-a/a combinations and add a backref to make it easier
authorMark Hymers <mhy@debian.org>
Sat, 2 May 2009 16:00:14 +0000 (17:00 +0100)
committerMark Hymers <mhy@debian.org>
Sun, 9 Aug 2009 15:49:20 +0000 (16:49 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/admin.py
daklib/dbconn.py

index 1cf80f2855a414d858fb1a7777a2101c9d5a2ccf..0f99bafc13f2ba6f7549b439dc3981d82033ce96 100755 (executable)
@@ -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)
index 32fbdb5526376e9dcdd0ca2af74756871fd1fa38..a9d4d4a7601d55b5f644ba746c22bf62d0d9e354 100755 (executable)
@@ -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)))