Patches item #2866300, was opened at 2009-09-25 14:08
Message generated for change (Tracker Item Submitted) made by gkassel
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Geoff Kassel (gkassel)
Assigned to: Nobody/Anonymous (nobody)
Summary: ConnectionHub.__get__ TypeError and patch
Initial Comment:
Hi,
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__
self._create(id, **kw)
File "//usr/lib/python2.5/site-packages/sqlobject/main.py", line 1271, in _create
self._SO_finishCreate(id)
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=2866300&group_id=74338
|