]> git.decadent.org.uk Git - dak.git/commitdiff
Fix sort order of property Suite.architectures.
authorTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 23:54:17 +0000 (00:54 +0100)
committerTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 23:54:17 +0000 (00:54 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/dbconn.py

index 72453f643d26dc35b768395d5d9886264d49b3eb..766efdb4a9e463f6b1b3837c3410037d2174a90c 100755 (executable)
@@ -46,7 +46,7 @@ from inspect import getargspec
 
 import sqlalchemy
 from sqlalchemy import create_engine, Table, MetaData, Column, Integer
-from sqlalchemy.orm import sessionmaker, mapper, relation, object_session
+from sqlalchemy.orm import sessionmaker, mapper, relation, object_session, backref
 from sqlalchemy import types as sqltypes
 
 # Don't remove this, we re-export the exceptions to scripts which import us
@@ -2852,8 +2852,10 @@ class DBConn(object):
 
     def __setupmappers(self):
         mapper(Architecture, self.tbl_architecture,
-               properties = dict(arch_id = self.tbl_architecture.c.id,
-                                 suites = relation(Suite, secondary=self.tbl_suite_architectures, backref='architectures', order_by='suite_name')))
+           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'))))
 
         mapper(Archive, self.tbl_archive,
                properties = dict(archive_id = self.tbl_archive.c.id,