[Zope] MySQL queries in Python

Jonathan dev101 at magma.ca
Tue Aug 1 14:56:07 EDT 2006


Have a look at this:

http://www.zope.org/Members/spinwing/ZSQL_Results



Jonathan
  ----- Original Message ----- 
  From: Muk Yan 
  To: zope at zope.org 
  Sent: Tuesday, August 01, 2006 2:50 PM
  Subject: [Zope] MySQL queries in Python


  Dear Coveted Braintrust,

  I was wondering if anyone had any experience with MySQL queries in Python in Zope:

  import MySQLdb
  import string

  request = container.REQUEST
  session = request.SESSION

  result = (context.aq_parent).selects.select_from_table()

  print result
  return printed

  WHERE select.select_from_table() IS:

  SELECT name
  FROM person
  WHERE ID = <dtml-var "REQUEST.SESSION.get ('person_id')">

  I know the MySQL query works, but I get garbage results from the python script (<Shared.DC.ZRDB.Results.Results instance at 0x132a5c88>).  All I want is to contain the results of the SQL query in a list or container. 

  Thanks and take care,
  Muk Yan



------------------------------------------------------------------------------


  _______________________________________________
  Zope maillist  -  Zope at zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists - 
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope-dev )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060801/dfd959cd/attachment.htm


More information about the Zope mailing list