From 348973b85292179b603c0c578ccd35cc045810d8 Mon Sep 17 00:00:00 2001 From: Brad Allen Date: Thu, 18 Mar 2010 08:41:54 -0600 Subject: [PATCH] Docstring improvements for MxDecimal and MxNumeric result processors. --- lib/sqlalchemy/connectors/mxodbc.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/sqlalchemy/connectors/mxodbc.py b/lib/sqlalchemy/connectors/mxodbc.py index 73cf22f010..d03fdb5ffc 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) -- 2.47.3