[Zope] Converting LazyCat to LazyMap?

Dieter Maurer dieter at handshake.de
Tue Oct 21 16:38:37 EDT 2003


Charlotte Pollock wrote at 2003-10-21 10:04 +0100:
 > I am querying two catalogs seperately, each returns its results as a 
 > LazyMap object. I now want to combine the two result sets, but when I 
 > do that they become a LazyCat object (which doesn't work with the Plone 
 > Batch scripts I am using)
 > 
 > Is there anyway to turn the LazyCat object into a LazyMap, or combine 
 > the two LazyMaps without creating a LazyCat?
 > 
 > Any answers, suggestions, or stabs in the dark welcome

It is impossible.

A "LazyMap" consists of a function and a sequence.
The result is the sequence (computed lazily) of applying the
function on each element of the sequence.

Two "LazyMap"s could only be combined to form a single
"LazyMap" when their function is identical (in this case,
you would concatenate the sequences and retain the function).

In your case, the function are (the same) methods of different
catalogs. They are not identical.


You could work around this by modifying both the function
and the sequences. But, there should be an easier solution.


Dieter



More information about the Zope mailing list