]> git.decadent.org.uk Git - dak.git/commitdiff
Really, really fix DebVersion.
authorTorsten Werner <twerner@debian.org>
Thu, 13 Jan 2011 18:31:18 +0000 (19:31 +0100)
committerTorsten Werner <twerner@debian.org>
Thu, 13 Jan 2011 18:31:18 +0000 (19:31 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
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"