5 Oct
2004
5 Oct
'04
12:38 p.m.
Hi, I'm trying to create a generic python script in Zope that will translate any SQL query into a dictionary. I've got it working when I put in the name of a specifc SQL query name, but I can't figure out the syntax/function to take a string that contains the ZSQL method name and use it in the code like I have below (which produces attribute errors): columns=2 # the number of columns needed query = "sql_getMySQL()" myObject = getattr(context,query) qresults=context.myObject.dictionaries() # this is done to get a real list return [qresults[index:index+columns] for index in range(0,len(qresults),columns)] Any suggestions? Duane