diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-13 10:01:42 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-13 10:01:42 -0500 |
| commit | 74beb02b044ed1e937d051660c2e802d3c7da7c9 (patch) | |
| tree | a6fbc366fa84306c2cbfcb323e3ce3373d2d365e /lib/sqlalchemy | |
| parent | 10fd2e8b0d198d0b489703c375fb5ac12cc26e4d (diff) | |
| download | sqlalchemy-74beb02b044ed1e937d051660c2e802d3c7da7c9.tar.gz | |
spoke too soon on that.
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/types.py | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index 480d9f883..1fa933683 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -149,22 +149,36 @@ class TypeEngine(AbstractType): dialect.type_descriptor(self)) def _cached_bind_processor(self, dialect): - key = "bind", dialect.__class__, dialect.server_version_info - try: - return self._impl_dict[key] - except KeyError: - self._impl_dict[key] = bp = \ - self.dialect_impl(dialect).bind_processor(dialect) - return bp + return self.dialect_impl(dialect).bind_processor(dialect) + + # TODO: can't do this until we find a way to link with the + # specific attributes of the dialect, i.e. convert_unicode, + # etc. might need to do a weakmap again. needs tests + # to ensure two dialects with different flags. use a mock + # dialect. + #key = "bind", dialect.__class__, dialect.server_version_info + #try: + # return self._impl_dict[key] + #except KeyError: + # self._impl_dict[key] = bp = \ + # self.dialect_impl(dialect).bind_processor(dialect) + # return bp def _cached_result_processor(self, dialect, coltype): - key = "result", dialect.__class__, dialect.server_version_info, coltype - try: - return self._impl_dict[key] - except KeyError: - self._impl_dict[key] = rp = self.dialect_impl(dialect).\ - result_processor(dialect, coltype) - return rp + return self.dialect_impl(dialect).result_processor(dialect, coltype) + + # TODO: can't do this until we find a way to link with the + # specific attributes of the dialect, i.e. convert_unicode, + # etc. might need to do a weakmap again. needs tests + # to ensure two dialects with different flags. use a mock + # dialect. + #key = "result", dialect.__class__, dialect.server_version_info, coltype + #try: + # return self._impl_dict[key] + #except KeyError: + # self._impl_dict[key] = rp = self.dialect_impl(dialect).\ + # result_processor(dialect, coltype) + # return rp def adapt(self, cls): return cls() |
