diff options
| author | Brad Allen <bradallen137@gmail.com> | 2010-03-18 08:41:54 -0600 |
|---|---|---|
| committer | Brad Allen <bradallen137@gmail.com> | 2010-03-18 08:41:54 -0600 |
| commit | 348973b85292179b603c0c578ccd35cc045810d8 (patch) | |
| tree | 23c8211dcf3dfb0693a3cb4871133e3a1d0b02d8 /lib/sqlalchemy/connectors/mxodbc.py | |
| parent | 55dc1241de3ed09fc4e0c395e281b6a82182f308 (diff) | |
| download | sqlalchemy-348973b85292179b603c0c578ccd35cc045810d8.tar.gz | |
Docstring improvements for MxDecimal and MxNumeric result processors.
Diffstat (limited to 'lib/sqlalchemy/connectors/mxodbc.py')
| -rw-r--r-- | lib/sqlalchemy/connectors/mxodbc.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sqlalchemy/connectors/mxodbc.py b/lib/sqlalchemy/connectors/mxodbc.py index 73cf22f01..d03fdb5ff 100644 --- a/lib/sqlalchemy/connectors/mxodbc.py +++ b/lib/sqlalchemy/connectors/mxodbc.py @@ -126,7 +126,15 @@ class MxNumeric(sqltypes.Numeric): def result_processor(self, dialect, coltype): """ - For cases when a + By default, the SQLAlchemy mxODBC connector is + configured to return Decimal values from + Numeric columns. In addition, the SQLAlchemy's + Numeric type is expected to return a Python Numeric, + so by default no action is needed. + + However, if the user specifies asdecimal=False + on a Decimal column, it is expected to return + a Python float. """ if self.asdecimal: return None @@ -148,7 +156,9 @@ class MxFloat(sqltypes.Float): def result_processor(self, dialect, coltype): """ mxODBC returns Python float values for REAL, FLOAT, and - DOUBLE column types. + DOUBLE column types, so if the user specifies 'asdecimal', + SQLAlchemy needs to coerce the value to a Decimal type. + Otherwise, no special action is needed. """ if self.asdecimal: return processors.to_decimal_processor_factory(Decimal) |
