[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Really, really fix DebVersion.



Signed-off-by: Torsten Werner <twerner@debian.org>
---
 daklib/dbconn.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/daklib/dbconn.py b/daklib/dbconn.py
index 9e1b29b..bae2bb3 100755
--- a/daklib/dbconn.py
+++ b/daklib/dbconn.py
@@ -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"
 
-- 
1.5.6.5



Reply to: