dabo Commit
Revision 7191
Date: 2012-05-18 09:11:13 -0700 (Fri, 18 May 2012)
Author: Johnf
Trac: http://trac.dabodev.com/changeset/7191
Changed:
U trunk/dabo/db/dCursorMixin.py
Log:
This should help determine the python datatype when for some reason the field
name is NOT in the self._types or the name is an alias.
examples are
self.addField("escourse.name_1 as course_name")
self.addField("esenroll.pkid::text", alias= 'pkidtext')
self.addField("extract(year from age(born)) as studentage")
Diff:
Modified: trunk/dabo/db/dCursorMixin.py
===================================================================
--- trunk/dabo/db/dCursorMixin.py 2012-05-17 20:23:01 UTC (rev 7190)
+++ trunk/dabo/db/dCursorMixin.py 2012-05-18 16:11:13 UTC (rev 7191)
@@ -232,8 +232,12 @@
"""
if field_val is None:
return field_val
+
pythonType = self._types.get(field_name,
dabo.db.getDataType(type(field_val)))
+ if not pythonType:
+ pythonType = dabo.db.getDataType(type(field_val))
+
if isinstance(field_val, pythonType):
# No conversion needed.
return field_val
_______________________________________________
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]