Dabo Error Log: Wed Sep 10 07:57:24 2008: !!! Data Type Mismatch:
field=cvendor. Expecting: <type 'str'>; got: <type 'unicode'>
The above error is caused by the following statement in my bizobj class
self.addField("apvend.cvendno as cvendor")
which is required for a join on two tables (apvend and aglots). Where aglots
is the primary.
And the actual code that prints the error is in dCursorMixin. So can I fix
this?
dCursorMixin code below is what prints the error:
if fldType != type(val):
ignore = False
# Date and DateTime types are handled as
character, even if the
# native field type is not. Ignore these. NOTE:
we have to deal with the
# string representation of these classes, as
there is no primitive for
either
# 'DateTime' or 'Date'.
dtStrings =
("<type 'DateTime'>", "<type 'Date'>", "<type 'datetime.datetime'>")
if str(fldType) in dtStrings and
isinstance(val, basestring):
ignore = True
elif isinstance(fldType, basestring) and
isinstance(val, basestring):
ignore = True
elif val is None or fldType is type(None):
# Any field type can potentially hold
None values (NULL). Ignore these.
ignore = True
elif isinstance(val, dNoEscQuoteStr):
# Sometimes you want to set it to a sql
function, equation, ect.
ignore = True
elif fld in nonUpdateFields:
# don't worry so much if this is just a
calculated field.
ignore = True
else:
# This can also happen with a new
record, since we just stuff the
# fields full of empty strings.
ignore =
self._newRecords.has_key(rec.get(keyField, None))
if not ignore:
msg = _("!!! Data Type Mismatch:
field=%s. Expecting: %s; got: %s") \
% (fld, str(fldType),
str(type(val)))
dabo.errorLog.write(msg)
--
John Fabiani
_______________________________________________
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]