dabo Commit
Revision 7187
Date: 2012-05-17 12:00:50 -0700 (Thu, 17 May 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7187
Changed:
U trunk/dabo/db/dCursorMixin.py
Log:
Was getting the following:
File "/home/pmcnett/dabo-full/trunk/dabo/db/dCursorMixin.py", line 270, in
_correctFieldType
scale = len(_field_val.split(".")[1])
AttributeError: 'int' object has no attribute 'split'
Because I guess sqlite's adapter returned the field as an int even though it can
contain decimal places. Adding the AttributeError fixes.
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2012-05-16 20:07:38 UTC (rev 7186)
+++ trunk/dabo/db/dCursorMixin.py 2012-05-17 19:00:50 UTC (rev 7187)
@@ -268,7 +268,7 @@
if scale is None:
try:
scale = len(_field_val.split(".")[1])
- except IndexError:
+ except (IndexError, AttributeError):
scale = 2
dec = tryToCorrect(Decimal, _field_val, field_name)
return dec.quantize(Decimal("0.%s" % (scale * "0",)))
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]