[Zope] How to check the result from ZSQL Method

Terry terry@taipeitimes.com
Thu, 24 Jan 2002 09:53:02 +0800


Hello Friends,

I have a ZSQL Method would select one row from MySQL, then I take the 
result like this in a Python Scropt.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## (Script) Pythoon
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=ar_id
##title=
one_row = script.sql_Read_News(ar_id=ar_id,ar_publish='Y' )
for row in one_row:
      ar_id = row.ar_id
      . .......
      .....
      ..
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The value of ar_id is right. But how do know there's a ar_id or some 
other properties.
For example:
How do I know, there is  a "ar_head", "ar_subhead", or .......( You may 
tell me to check the field name of my table in my DB, but I would
like to mix sereral row to a list and they come from different table..)
Is there a function to check this, or I just use one_row.names() to 
memorize the list of the result.

Is there a function to tell me exactly the type of result from the ZSQL 
Method ?
  ex:  print  type(row.ar_id)  

Many many thanks for your help.

Have a nice day

Terry