[Zope] How to identy a fieldname exist or not?

Terry terry@taipeitimes.com
Tue, 29 Jan 2002 18:28:50 +0800


Hello friends,

I have a table1 in database. Have fieldnames like 
"book_id","bookname",table2 has  "user_id","username"

I use a Python Script call a ZSQL Method and get result from that ZSQL 
Method.
There is not any fieldname like "phone".
Why I couldn't check this in Python Script?
Zope said this on my browser
"""


    Site Error

An error was encountered while publishing this resource.

*Error Type: AttributeError*
*Error Value: user_id*

"""

###My Python Script
result1 =some_ZSQL_Method_table1
result2 =some_ZSQL_Method_table2

result =[]
 for i in range(len(result1)):
         result.append(result1[i])
         if len(result2) >= i+1:
              result.append(result2[i])
 if result:
    for i in result:
          if i.user_id:
                print "This table have fieldname named user_id"

return printed
 #################

Any idea ?

Terry