Re: [SQLObject] Bug? Spurious connection to postgresql
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Iwan V. <iw...@re...> - 2008-12-13 21:54:55
|
On Sat, 2008-12-13 at 23:37 +0200, Iwan Vosloo wrote: > On Sat, 2008-12-13 at 20:39 +0300, Oleg Broytmann wrote: > > On Sat, Dec 13, 2008 at 07:26:14PM +0200, Iwan Vosloo wrote: > Maybe a simple workaround would be to implement a server_version method > on the Transaction too? (Or to just set it to a value.) Yup, I have verified this as a workaround. The following code works correctly: import sqlobject connectionURI = 'postgres://rhug:rhug@localhost/rhug' import pdb; pdb.set_trace() conn = sqlobject.connectionForURI(connectionURI).transaction() # The workaround, so that __getattr__ would not get called: conn.server_version = conn.queryOne("SELECT version()")[0][1] class TestMe(sqlobject.SQLObject): pass TestMe.createTable(connection=conn) TestMe.dropTable(connection=conn) |