]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
Really, really fix DebVersion.
[dak.git] / daklib / dbconn.py
index 9e1b29bbe44ca84845ac81d2a258059037c7cb52..bae2bb355c3cc24869d0c166f027adba4955de43 100755 (executable)
@@ -64,7 +64,14 @@ from dak_exceptions import NoSourceFieldError
 # Patch in support for the debversion field type so that it works during
 # reflection
 
-class DebVersion(sqltypes.UserDefinedType):
+try:
+    # that is for sqlalchemy 0.6
+    UserDefinedType = sqltypes.UserDefinedType
+except:
+    # this one for sqlalchemy 0.5
+    UserDefinedType = sqltypes.TypeEngine
+
+class DebVersion(UserDefinedType):
     def get_col_spec(self):
         return "DEBVERSION"