Hi everyone,

I'm using Postgresql 8.1 with psycopg2 and have been getting this
error on both SQLObject 0.8.2 as well as 0.9.0b1. It's driving me
crazy, and I'd really appreciate any help you can give me.

Basically, SQLObject gives me the following error/traceback when I try
to insert a row that has a StringCol in it:

Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/declarative.py",
line 94, in _wrapper
   return fn(self, *args, **kwargs)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/main.py",
line 1216, in __init__
   self._create(id, **kw)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/main.py",
line 1247, in _create
   self._SO_finishCreate(id)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/main.py",
line 1271, in _SO_finishCreate
   id, names, values)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/dbconnection.py",
line 396, in queryInsertID
   return self._runWithConnection(self._queryInsertID, soInstance,
id, names, values)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/dbconnection.py",
line 255, in _runWithConnection
   val = meth(conn, *args)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/postgres/pgconnection.py",
line 133, in _queryInsertID
   q = self._insertSQL(table, names, values)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/dbconnection.py",
line 388, in _insertSQL
   return ("INSERT INTO %s (%s) VALUES (%s)" %
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/dbconnection.py",
line 755, in sqlrepr
   return sqlrepr(v, self.dbName)
 File 
"/usr/lib/python2.4/site-packages/SQLObject-0.9.0b1-py2.4.egg/sqlobject/converters.py",
line 235, in sqlrepr
   raise ValueError, "Unknown SQL builtin type: %s for %s" % \
ValueError: Unknown SQL builtin type: <class
'sqlobject.col.StringCol'> for <StringCol 4885dbd4 name>

I got the above error when I tried to do:
Person(owner=a, wildCoords=o, name='Test')

'owner' and 'wildCoords' are Foreign Keys, and their instances 'a' and
'o' do exist and were created successfully like this:

a = Account(name='Test')
o = WildCoord(coords='(0,0)')

I've attached a short .py file that replicates the problem. You might
want to change the database name and login details, and then do the
following:

prompt> python -i pggeomtest.py
WildCoord.createTable()
Account.createTable()
Person.createTable()
a = Account(name='Test')
o = WildCoord(coords='(0,0)')
Person(owner=a, wildCoords=o, name='Test')

And that should recreate the problem. Any and all help would be very welcome.

YW

Attachment: pggeomtest.py
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to