diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-19 11:55:59 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-19 11:55:59 -0400 |
| commit | 32f8a11153b4c15391e9650498ebf2f0626f063c (patch) | |
| tree | 7805c1b2b399cd89a1426ce558ee2a3fc763ef8b /lib/sqlalchemy/connectors | |
| parent | 7a8f05d4353f90b734ff878a03d5bb68351ad65b (diff) | |
| download | sqlalchemy-32f8a11153b4c15391e9650498ebf2f0626f063c.tar.gz | |
still poking at numerics
Diffstat (limited to 'lib/sqlalchemy/connectors')
| -rw-r--r-- | lib/sqlalchemy/connectors/pyodbc.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/connectors/pyodbc.py b/lib/sqlalchemy/connectors/pyodbc.py index 82e510754..5cf00bc92 100644 --- a/lib/sqlalchemy/connectors/pyodbc.py +++ b/lib/sqlalchemy/connectors/pyodbc.py @@ -10,6 +10,8 @@ from sqlalchemy import processors, types as sqltypes class PyODBCNumeric(sqltypes.Numeric): """Turns Decimals with adjusted() < -6 into floats, > 7 into strings""" + convert_large_decimals_to_string = False + def bind_processor(self, dialect): super_process = super(PyODBCNumeric, self).bind_processor(dialect) @@ -19,7 +21,8 @@ class PyODBCNumeric(sqltypes.Numeric): if value.adjusted() < -6: return processors.to_float(value) - elif value.adjusted() > 7: + elif self.convert_large_decimals_to_string and \ + value.adjusted() > 7: return self._large_dec_to_string(value) if super_process: |
