Re: [SQLObject] q-magic + multiple connections
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2010-10-14 08:27:51
|
Hello! On Wed, Oct 13, 2010 at 04:48:44PM -0700, Octav Chipara wrote: > This also fails to work with selectby as shown in the example below. It > looks like IntCols can be handled correctly but StringCol cannot. > > > File > > "/Library/Python/2.6/site-packages/SQLObject-0.13.0-py2.6.egg/sqlobject/sqlbuilder.py", > > line 341, in _from_python > > value = column.from_python(value, SQLObjectState(self.soClass)) > > File > > "/Library/Python/2.6/site-packages/SQLObject-0.13.0-py2.6.egg/sqlobject/col.py", > > line 501, in to_python > > connection = state.soObject._connection > > File > > "/Library/Python/2.6/site-packages/SQLObject-0.13.0-py2.6.egg/sqlobject/dbconnection.py", > > line 837, in __get__ > > return self.getConnection() > > File > > "/Library/Python/2.6/site-packages/SQLObject-0.13.0-py2.6.egg/sqlobject/dbconnection.py", > > line 850, in getConnection > > "No connection has been defined for this thread " > > AttributeError: No connection has been defined for this thread or process > > Exception AttributeError: "'NoneType' object has no attribute 'print_exc'" > > in <function _removeReceiver at 0x1004e3398> ignored You stumbled over exactly the same problem that was discussed a day or two ago - sometimes validators (especially validators for StringCol) need to know the current connection (StringCol's validator needs to know charset/encoding). Please test the patch that I sent and report back if it helps. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |