On 5/12/11 2:16 PM, John Fabiani wrote:
> Why are some of the fields datatypes are noted but others are not? And of
> course the mustenrollby has no datatype?
sqlite has no real defined way to specify data types, so not all of the
possibilities
are noted in the type mapping. I guess the most noticeable of these missing
mappings
would be logical (bool) values which typically get saved as 0/1 in the table
but
dCursorMixin converts to python False/True.
mustenrollby has no datatype because the first record's value was NULL (python
None)
and NoneType doesn't exist in the mapping (how could it?)
Please try this patch out and let me know if it works. I haven't tested it. If
there's a parent Cursor in the picture and it uses the same field names it
should be
able to pick up the field type from there.
Index: dDataSet.py
===================================================================
--- dDataSet.py (revision 6589)
+++ dDataSet.py (working copy)
@@ -280,7 +280,11 @@
try:
retList.append("%s %s" % (safekey,
ds._typeDict[typ]))
except KeyError:
- retList.append(safekey)
+ # try the cursor field structure.
+ try:
+ retList.append("%s %s" % (safekey,
ds._typeDict[self.Cursor._types[safekey]
+ except (KeyError, AttributeError):
+ retList.append(safekey)
return "create table %s (%s)" % (alias, ", ".join(retList))
@@ -449,7 +453,7 @@
_("Reference to the bizobj that 'owns' this data set.
Default=None (bizobj)"))
Cursor = property(_getCursor, _setCursor, None,
- _("Reference to the bizobj that 'owns' this data set.
Default=None (dCursorMixin)"))
+ _("Reference to the cursor that 'owns' this data set.
Default=None (dCursorMixin)"))
Encoding = property(_getEncoding, _setEncoding, None,
_(" The encoding used for data in the dataset. (str)"))
_______________________________________________
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]