[Zope] Newby question: Finding unique values from a ZCatalog, matching a criteria

Thomas Guettler zopestoller@thomas-guettler.de
Tue, 12 Mar 2002 09:02:06 +0100


Dianne Van Dulken wrote:

>Hi, 
>
>This is probably going to be a laughably easy question for most of you, but
>it is confusing me no end.  I have a ZCatalog set up for a list of
>merchants.  They can be active, inactive or pending.  The merchant name
>isn't unique, as there can be one merchant in books, same one in DVDs, etc.
>
>What I am trying to do is to return a unique list of all merchants who are
>active.
>
>If I use 
>
><dtml-in "CatalogMerCat(sort_by='merchant', status='Active')">
>
>I get all active ones, but are getting Merchant1, Merchant1, Merchant2, etc.
>
One solution would be to write your own uniqueValues method:

<dtml in "myUniqueValues(CatalogMerCat(...))">

 thomas