]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Docstring improvements for MxDecimal and MxNumeric result processors.
authorBrad Allen <bradallen137@gmail.com>
Thu, 18 Mar 2010 14:41:54 +0000 (08:41 -0600)
committerBrad Allen <bradallen137@gmail.com>
Thu, 18 Mar 2010 14:41:54 +0000 (08:41 -0600)
lib/sqlalchemy/connectors/mxodbc.py

index 73cf22f01004d2a3eeffb0599a2a4d4ec98ae293..d03fdb5ffcb26ac349816f2e68a633eba2c206fa 100644 (file)
@@ -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)