/srv/irclogs.ubuntu.com/2004/09/15/#launchpad.txt

spivpostgres statement logging is too late -- the query never reaches postgres.12:03
spivThe simplest way would be to insert a print just before the relevant line in zope.app.rdb, -- what's the fnal part of the traceback?12:04
=== elmo [~james@83.216.141.215] has joined #launchpad
daf    *  Module canonical.rosetta.sql, line 678, in createMessageSetFromText12:07
daf      return createMessageSetFromText(self, text)12:07
daf    * Module canonical.rosetta.sql, line 291, in createMessageSetFromText12:07
daf      if messageIDs.count() == 0:12:07
daf    * Module sqlobject.main, line 1211, in count12:07
daf      count = self.accumulate('COUNT(*)')12:07
daf    * Module sqlobject.main, line 1207, in accumulate12:07
daf      return conn.accumulateSelect(self,expression)12:07
daf    * Module sqlobject.dbconnection, line 249, in accumulateSelect12:07
daf      val = int(self.queryOne(q)[0] )12:07
daf    * Module sqlobject.dbconnection, line 223, in queryOne12:07
daf      return self._runWithConnection(self._queryOne, s)12:07
daf    * Module sqlos.adapter, line 60, in _runWithConnection12:07
daf      raise DatabaseException, tuple(exc.args)12:07
dafDatabaseException: unindexable object12:08
spivActually, turning on debug in SQLObject would be sufficient.12:09
dafcould you remind me how I do that?12:10
spivExcept the current sqlos seems to override that :/12:10
spivsqlobject/dbconnection.py is what I edit.12:10
spivYou may need to remove self.debug = 0 from sqlos/adapter.py, too.12:11
daf<sqlobject.main.SelectResults object at 0xb421f7cc>12:18
daf 1/Pool    :  ACQUIRE pool=[] 12:18
daf 1/QueryOne:  SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %%d contact will open %%d new window as well.\r\nDo you really want to display this contact?'12:18
daf 1/Pool    :  RELEASE (implicit, autocommit=None) pool=[] 12:18
dafbut, also:12:18
daf 1/Pool    :  ACQUIRE pool=[] 12:18
daf 1/QueryOne:  SELECT COUNT(*) FROM POMsgID WHERE msgid = 'Opening %d contact will open %d new window as well.\r\nDo you really want to display this contact?'12:18
daf 1/Pool    :  RELEASE (implicit, autocommit=None) pool=[] 12:18
spivAlso?  Weird.12:22
spivThe second one fails I presume?12:22
dafI presume so too12:22
spiv:)12:22
dafah, think I've found the second one12:26
dafspiv: ok, I think I've sorted out the SELECTs12:35
dafspiv: now an INSERT is being a pain12:35
dafspiv: shouldn't this stuff be automatically escaped in SQLObject?12:36
spivProbably, yes.12:36
dafis it difficult to fix?12:37
spiv(Which has the added suck that fixing it in SQLObject will break our code thatwe're writing now that assumes the fix isn't there)12:37
dafi.e. should I do a workaround, or wait for it to be fixed properly?12:37
dafis it only a problem with percent signs?12:37
dafspeaking of the Rosetta code, there's not much code which is affected12:38
spivI'd workaround it.12:40
dafok, I know how to hack SELECTS to work12:40
spiv(man, my wireless is screwing up for some reason)12:40
dafhow do I do the same for INSERTs?12:40
spivYes, it's only % -- it's because Python's printf-like formatting is being invoked.12:44
dafright12:44
dafit is a bug, right?12:45
=== limi [~limi@sparkit.easynet.no] has joined #launchpad
spiv(i.e. psycopg's cursor.execute does  query % params )12:47
spiv(sorry about the lag -- my wireless keeps dropping out for no apparent reason)12:48
spivYou'd fix it for INSERTs the same way -- escape % as %% in any strings.12:48
dafusing which method?12:49
spivfoo.replace('%', '%%')12:50
spivHow are you donig it for SELECTS? :)12:50
dafClass.select()12:50
dafI've always used Class(...) for insertions previously12:51
spivUm, I think we're talking at cross-purposes.12:53
spivYou can do Class(foo=foo.replace('%', '%%'))12:54
dafok, that's what I wanted to know12:54
dafsorry, I'm tired12:54
spivAnd you can do Class.selectBy(foo=foo.replace('%', '%%'))12:54
dafoh, right12:55
=== limi [~limi@sparkit.easynet.no] has joined #launchpad
=== limi [~limi@sparkit.easynet.no] has joined #launchpad
=== limi [~limi@sparkit.easynet.no] has joined #launchpad
=== elmo [~james@83.216.141.215] has joined #launchpad
=== lalo [~lalo@200-203-033-222.paemt7005.dsl.brasiltelecom.net.br] has joined #launchpad
=== stub [~zen@dialup-31.81.220.203.acc05-dryb-mel.comindico.com.au] has joined #launchpad
=== elmo_ [~james@83.216.141.215] has joined #launchpad
=== elmo_ [~james@83.216.141.215] has joined #launchpad
=== wartylog [~warthylog@port1845.ds1-khk.adsl.cybercity.dk] has joined #launchpad
=== Topic for #launchpad: <kiko> how's england? <daf> wet <daf> but soon, I will go back to Wales <kiko> and how will wales be? <daf> probably wet, too
=== Topic (#launchpad): set by kiko at Fri Aug 27 16:07:21 2004
=== limi is now known as ltr|imil
=== ltr|imil is now known as limi
=== mdz [~mdz@69-167-148-207.vnnyca.adelphia.net] has joined #launchpad

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!