From: Mike Bayer Date: Sun, 1 Nov 2009 23:28:44 +0000 (+0000) Subject: fix adapt() so that DB-specified typedecorator replacements work X-Git-Tag: rel_0_6beta1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b8292ec6afa79ea76b07a59a2e3aef1b2edb176;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix adapt() so that DB-specified typedecorator replacements work --- diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index 92ff274f88..c60f214f9a 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -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__]