Found a TypeError raised from ConnectionHub.__get__ that seems to happen when overriding the SQLObject.__init__ method.
Here's the associated trace:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/lvm/var/www/localhost/webapp/product/product/model/dbfile.py", line 220, in __init__
SQLObject.__init__(self, contentType = contentType, _data = data)
File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1223, in __init__
File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1271, in _create
File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1294, in _SO_finishCreate
id = self._connection.queryInsertID(self,
File "//usr/lib/python2.5/site-packages/turbogears/database.py", line 273, in __get__
return self.hub.__get__(obj, type)
File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 826, in __get__
if obj and obj.__dict__.has_key('_connection'):
TypeError: an integer is required
The object 'obj' in question is an uninitialized SQLObject (an object of a database-backed file class named DBFile), and the error is raised from the 'if obj' condition.
I've fixed this with the attached patch.
Log in to post a comment.