[Zope] Help with Zope Python result object please!

Gabriel Genellina gagenellina at softlab.com.ar
Fri Dec 30 16:10:32 EST 2005


At Friday 30/12/2005 14:32, Alric Aneron wrote:

>I have a python code that recieves two result objects from two different 
>ZSQL methods.  I need to join them (sort of like UNION).
>I can't do result1+result2, otherwise it raises an exception that the + 
>operator isn't supported.

This is *untested* but looking at the Results constructor, it does not use 
its data argument in any way (just stores it in the instance).
If you are *sure* both results have the same columns in the same position 
and all are the same type and size and..., you could do:
         R1._data = R1._data + R2._data
(in a product or external method)

Or, create a new instance: Results((R1.__items__, R1._data + R2._data))


Gabriel Genellina
Softlab SRL 



More information about the Zope mailing list