dabo Commit
Revision 7119
Date: 2012-03-20 13:30:23 -0700 (Tue, 20 Mar 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7119
Changed:
U trunk/dabo/db/dCursorMixin.py
Log:
Removed implicitly setting self._types from within correctFieldType, because
it already happens in the requery cycle. If it hadn't been done, it is because
we are an AuxCursor and so it is dangerous to set it for this dataset and have
the value persist to possible future datasets.
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2012-03-20 04:52:02 UTC (rev 7118)
+++ trunk/dabo/db/dCursorMixin.py 2012-03-20 20:30:23 UTC (rev 7119)
@@ -230,9 +230,10 @@
"""
if field_val is None:
return field_val
- pythonType = self._types.get(field_name, None)
- if pythonType is None or pythonType == type(None):
- pythonType = self._types[field_name] =
dabo.db.getDataType(type(field_val))
+ try:
+ pythonType = self._types[field_name]
+ except KeyError:
+ pythonType = dabo.db.getDataType(type(field_val))
if isinstance(field_val, pythonType):
# No conversion needed.
@@ -243,8 +244,8 @@
return func(field_val)
except Exception, e:
tfv = type(field_val)
- dabo.log.info(_("_correctFieldType() failed for
field: "
- "'%(field_name)s'; value:
'%(field_val)s'; type: '%(tfv)s'") % locals())
+ dabo.log.error(_("_correctFieldType() failed
for field: "
+ "'%(field_name)s' (%(func)s);
value: %(field_val)s (%(tfv)s)") % locals())
if pythonType in (unicode,):
# Unicode conversion happens below.
_______________________________________________
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]