]> git.decadent.org.uk Git - dak.git/commitdiff
Stop passing order_by as a string.
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 6 May 2012 15:47:15 +0000 (17:47 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Tue, 8 May 2012 19:55:48 +0000 (21:55 +0200)
This no longer worked with SQLAlchemy 0.7.

dak/admin.py
daklib/dbconn.py

index e109877faf0d5606fd5fb1ebe4049f973a821da5..de324bfd084fdd4445358278a23391e92dc91641 100755 (executable)
@@ -110,7 +110,7 @@ Perform administrative work on the dak database.
 ################################################################################
 
 def __architecture_list(d, args):
-    q = d.session().query(Architecture).order_by('arch_string')
+    q = d.session().query(Architecture).order_by(Architecture.arch_string)
     for j in q.all():
         # HACK: We should get rid of source from the arch table
         if j.arch_string == 'source': continue
@@ -184,7 +184,7 @@ dispatch['a'] = architecture
 
 def __suite_list(d, args):
     s = d.session()
-    for j in s.query(Suite).order_by('suite_name').all():
+    for j in s.query(Suite).order_by(Suite.suite_name).all():
         print j.suite_name
 
 def __suite_show(d, args):
@@ -236,7 +236,7 @@ def __suite_add(d, args, addallarches=False):
 
     if addallarches:
         arches = []
-        q = s.query(Architecture).order_by('arch_string')
+        q = s.query(Architecture).order_by(Architecture.arch_string)
         for arch in q.all():
             suite.architectures.append(arch)
             arches.append(arch.arch_string)
@@ -273,7 +273,7 @@ dispatch['s'] = suite
 
 def __suite_architecture_list(d, args):
     s = d.session()
-    for j in s.query(Suite).order_by('suite_name'):
+    for j in s.query(Suite).order_by(Suite.suite_name):
         architectures = j.get_architectures(skipsrc = True, skipall = True)
         print j.suite_name + ': ' + \
               ', '.join([a.arch_string for a in architectures])
@@ -375,7 +375,7 @@ dispatch['s-a'] = suite_architecture
 
 def __version_check_list(d):
     session = d.session()
-    for s in session.query(Suite).order_by('suite_name'):
+    for s in session.query(Suite).order_by(Suite.suite_name):
         __version_check_list_suite(d, s.suite_name)
 
 def __version_check_list_suite(d, suite_name):
index fd2ea345a31942e882786bb36d9b872f8ec2f382..c0295e17273cc02f3d1911ceeafdd9d35c6e4bc7 100755 (executable)
@@ -3357,8 +3357,8 @@ class DBConn(object):
         mapper(Architecture, self.tbl_architecture,
             properties = dict(arch_id = self.tbl_architecture.c.id,
                suites = relation(Suite, secondary=self.tbl_suite_architectures,
-                   order_by='suite_name',
-                   backref=backref('architectures', order_by='arch_string'))),
+                   order_by=self.tbl_suite.c.suite_name,
+                   backref=backref('architectures', order_by=self.tbl_architecture.c.arch_string))),
             extension = validator)
 
         mapper(Archive, self.tbl_archive,