[Zope] zsql .dictionaries() question
David Golden
goldcart@bellsouth.net
Tue, 7 Aug 2001 18:47:35 -0400
Zope and Python newbie. Insights / direction much appreciated.
I'm trying to return a dictionary representation of a ZSQL result via
a Python script. I'm accessing the script via a URL like:
//host:8080/Application/SqlMethod/DictScript
The following seems to work:
items=[]
for row in context():
rec={}
for fld in context().names():
rec[fld]=row[fld]
items.append(rec)
return items
but I'd like to use the result object method, .dictionaries()
along the lines of
return context().dictionaries()
which fails with an attribute error in
lib\python\Products\PythonScripts\Guarded.py
Interestingly enough
return context().names() and return context().data_dictionary
both work fine.
I expect I'm missing something obvious
Thanks in advance
David Golden