[Zope] What kind of objects is returned from Z SQL objects?

Oliver Bleutgen myzope@gmx.net
Fri, 06 Sep 2002 15:12:43 +0200


Oliver Marx wrote:
> Dear List,
> 
> I have two ZSQL objects and I want to 'add' them.
> 
> First I thought that the returned objects behave like dictionaries, but 
> that seems not to be the case.
> 
> Any ideas?
> 

They are "brains", see
lib/python/Shared/DC/ZRDB/Results.py
of your local Zope for the source.

They have for instance a method dictionaries() which returns your result 
set as a dictionary, e.g.

result = yoursqlmethod(....)
result_dict = result.dictionaries()


should give you a dictionary in a python script.


HTH,
oliver