]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
daklib/dbconn.py: use unicode workaround also for sqlalchemy 0.7
[dak.git] / daklib / dbconn.py
index 08765171442890abb1cdaf415e5ee50fc3a250da..413a0fdd1fcf5fc33a96c969f850bf17d9fdf1d7 100644 (file)
@@ -1030,7 +1030,9 @@ class PoolFile(ORMObject):
     @property
     def fullpath(self):
         session = DBConn().session().object_session(self)
-        af = session.query(ArchiveFile).join(Archive).filter(ArchiveFile.file == self).first()
+        af = session.query(ArchiveFile).join(Archive) \
+                    .filter(ArchiveFile.file == self) \
+                    .order_by(Archive.tainted.desc()).first()
         return af.path
 
     @property
@@ -2890,7 +2892,7 @@ class DBConn(object):
             engine_args['pool_size'] = int(cnf['DB::PoolSize'])
         if cnf.has_key('DB::MaxOverflow'):
             engine_args['max_overflow'] = int(cnf['DB::MaxOverflow'])
-        if sa_major_version == '0.6' and cnf.has_key('DB::Unicode') and \
+        if sa_major_version in ('0.6', '0.7') and cnf.has_key('DB::Unicode') and \
             cnf['DB::Unicode'] == 'false':
             engine_args['use_native_unicode'] = False