Columns returned from ZSQL query (was: [Zope] How to check the result from ZSQL Method)

Terry terry@taipeitimes.com
Mon, 28 Jan 2002 10:10:18 +0800


Thanks to the people on the list,

Yap, I knew the "names()" the available column names. But actually I mix 
several result from different tables.

Finally, I found in "Python Script".

# result is the query result

for i in result:
       if  i.some_column_name_of_table1:
            print "Yes, we had some_column_name_of_table1"

       if  i.some_column_name_of_table2:
            print "Yes, we had some_column_name_of_table2"

# seems very easy, but took me hours


Thanks again
I hope all newbies  could find the Zope way.(I'm one of them.)

Terry


Dieter Maurer wrote:

>Terry writes:
>
>>....
>>
>ZSQL method results have a method "names" returning the
>available column names.
>
>
>Dieter
>
>