Related to a previous post, I've simplified a model (running in
sqlite) to show the failure:

========= begin model.py =========
from turbogears.database import PackageHub
from sqlobject import *

hub = PackageHub('bupc')
__connection__ = hub

class owner(SQLObject):
    my_pcinfo = ForeignKey('pcinfo',cascade=True)
    FirstName = StringCol(length=20, varchar=True)
    LastName = StringCol(length=30, varchar=True)

class pcinfo(SQLObject):
    IPNbr = StringCol(length=15,varchar=True)
    HostName = StringCol(length=40, varchar=True)

========= end model.py =========

When the ForeignKey() statement is present, trying to instantiate
owner(), I get the following error:
In [1]: o=model.owner()
...
/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg/sqlobject/
converters.py in sqlrepr(obj, db)
    234         if converter is None:
    235             raise ValueError, "Unknown SQL builtin type: %s
for %s" % \
--> 236                   (type(obj), repr(obj))
    237         return converter(obj, db)
    238     else:

<type 'exceptions.ValueError'>: Unknown SQL builtin type: <type
'classobj'> for <class sqlobject.sqlbuilder.NoDefault at 0x860ca1

This only happens when the ForeignKey statement is present. the error
stanza implies a 'converter'.  Is there a converter class that the
model needs to see?

Thanks in advance for any hints.

Harry



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to