[Zope] ZCatalog OR search problems

Oliver Frommel oliver@aec.at
Sat, 24 Feb 2001 17:20:07 +0100 (CET)


ok, I see the problem is using the mybrain instances as keys in the dictionary
which doesn't work (in Python anyway). So I've switched to using a list and
somehow it works (ie. no errors) but doesn't return a list with unique 
values. Is it possible to test for equality of mybrains (I assume this is 
what the "in" operator uses somewhere)??

here's the new code:
def uniq2(items):
   arr = []
   for item in items:
       if not item in arr:
          arr.append(item)
   return arr


thanks for any help
--Oliver

> 
> <dtml-in "uniq(items=res)" size=50 start=query_start>
> ...
> 
> python method (parameter "items"):
> d = {}
> for item in items:
>     d.update( { item: 1 } )
> return d.keys()
>