Użytkownik Ed Leafe napisał:
> I just pushed a fix. I went with a minimally invasive approach, rather
> than something that always ran the code, since 99%+ of the time it isn't
> needed.
>
> It works with a PostgreSQL double precision column in my tests; let me
> know if it solves your issues.
>
I modified your patch a bit and it works now:
--- dCursorMixin.py (revision 5627)
+++ dCursorMixin.py (working copy)
@@ -198,23 +198,23 @@
self.DataStructure reports. The latter can happen with SQLite,
for example,
which only knows about a quite limited number of types.
"""
+ if field_val is None:
+ return field_val
ret = field_val
if _newQuery or (field_name in self._fieldsToAlwaysCorrectType):
- pythonType = self._types.get(field_name, type(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))
- self._fieldsToAlwaysCorrectType.append(field_name)
if pythonType is None or isinstance(field_val, pythonType):
# No conversion needed.
return ret
+ self._fieldsToAlwaysCorrectType.append(field_name)
+
if pythonType in (unicode,):
# Unicode conversion happens below.
pass
- elif field_val is None:
- # Fields of any type can be None (NULL).
- return field_val
elif pythonType in (datetime.datetime, ) and
isinstance(field_val, basestring):
ret = dates.getDateTimeFromString(field_val)
if ret is None:
But I still think, that data type conversion in Dabo is messy.
I still get different data type for the same field, depend on place
where cursor is created, but I'm afraid I have deal with that.
--
Regards
Jacek Kałucki
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]