[Twisted-web] Nevow + adbapi

Christopher Armstrong radeex at gmail.com
Thu Mar 10 17:06:47 MST 2005


On Thu, 10 Mar 2005 17:34:26 -0600, Luis N <tegmine at gmail.com> wrote:
> I must be a total moron:
> 
> I have this:
> 
> def query():
>     return dbpool.runQuery("SELECT english FROM lang WHERE spanish LIKE 'hola'")
> 
> def result(res):
>     if res:
>         print res[0][0]
>     else:
>         print "Failed."

Change that 'print res[0][0]' to a 'return res[0][0]', perhaps.


-- 
  Twisted   |  Christopher Armstrong: International Man of Twistery
   Radix    |    -- http://radix.twistedmatrix.com
            |  Release Manager, Twisted Project
  \\\V///   |    -- http://twistedmatrix.com
   |o O|    |  Founding Member, Hobart Hacking Society
w----v----w-+    -- http://hackingsociety.org/chapters/hash



More information about the Twisted-web mailing list