]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix adapt() so that DB-specified typedecorator replacements work
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Nov 2009 23:28:44 +0000 (23:28 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Nov 2009 23:28:44 +0000 (23:28 +0000)
lib/sqlalchemy/types.py

index 92ff274f8848f5c5f7b06219924c67ed03a7dfcf..c60f214f9a8b9ade43fa11a2a789c6bdd9954166 100644 (file)
@@ -224,7 +224,10 @@ class TypeDecorator(AbstractType):
             raise AssertionError("TypeDecorator implementations require a class-level "
                         "variable 'impl' which refers to the class of type being decorated")
         self.impl = self.__class__.impl(*args, **kwargs)
-
+    
+    def adapt(self, cls):
+        return cls()
+        
     def dialect_impl(self, dialect):
         try:
             return self._impl_dict[dialect.__class__]