diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-16 18:25:11 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-16 18:25:11 +0000 |
commit | 13af7230dcb0bf720a7a46f701404fa16b298c13 (patch) | |
tree | 272340c9a19a87b20081c04681515e936009c58e /lib/sqlalchemy/sql.py | |
parent | 6e6f4c0c94931325de658f12ede25b578beaec1a (diff) | |
download | sqlalchemy-13af7230dcb0bf720a7a46f701404fa16b298c13.tar.gz |
- fix to bind param processing such that "False" values (like blank strings)
still get processed/encoded
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 7d4bbcc78..bad60bb3c 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -862,23 +862,21 @@ class ClauseParameters(object): def get_original_dict(self): return dict([(name, value) for (b, name, value) in self.__binds.values()]) + def __get_processed(self, key, processors): + if key in processors: + return processors[key](self.__binds[key][2]) + else: + return self.__binds[key][2] + def get_raw_list(self, processors): -# (bind, name, value) = self.__binds[key] - return [ - (key in processors) and - processors[key](self.__binds[key][2]) or - self.__binds[key][2] - for key in self.positional - ] + return [self.__get_processed(key, processors) for key in self.positional] def get_raw_dict(self, processors, encode_keys=False): if encode_keys: return dict([ ( key.encode(self.dialect.encoding), - (key in processors) and - processors[key](self.__binds[key][2]) or - self.__binds[key][2] + self.__get_processed(key, processors) ) for key in self.keys() ]) @@ -886,9 +884,7 @@ class ClauseParameters(object): return dict([ ( key, - (key in processors) and - processors[key](self.__binds[key][2]) or - self.__binds[key][2] + self.__get_processed(key, processors) ) for key in self.keys() ]) |