[Zope-dev] An idea for UniqueValuesFor

Casey Duncan cduncan@kaivo.com
Fri, 27 Jul 2001 12:18:18 -0600


Chris Withers wrote:
> 
> I quite often need to do something like:
> 
> results =
> MyCatalog(meta_type='Person',continent='Africa').uniqueValuesFor('FirstName')
> 
> ...which would give you the minimal list of firstnames of people who live in
> Africa. A bit contrived but I seem to bump into lots of real world cases where I
> need to do similar.
> 
> What I currently have to do is the brutal and slow approach of "walk through the
> results" :-S
> 
> But Anthony came up with a great suggestion:
> 
> > What would make more sense (maybe?) is
> > results =
> > MyCatalog(meta_type='Person',continent='Africa',uniqueValuesFor='FirstName')
> 
> What do other people think? Is there a nice fast way of implementing this?
> 
> cheers,
> 
> Chris
> 

possibly, yes. I'll look to add this to my CatalogQuery product. I
believe the btrees can be pressed into service here...

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>