[Zope] ZCatalog with OR expression

sean.upton@uniontrib.com sean.upton@uniontrib.com
Thu, 18 Oct 2001 12:42:16 -0700

If this helps, ***within a single index***, dtml-in does "lazy
concatenation" which works ok.  Example query:


In this query, the adDate index is used twice, and 2 catalog queries are
performed by the dtml-in iteration machinery, and concatenated together, and
sorted together by dtml-in...

I think that Casey's CatalogQuery product might give you OR across certain
fields, but I'm not sure if there are any "perfect" solutions.


-----Original Message-----
From: Garikoitz Araolaza [mailto:gari@eibar.org]
Sent: Thursday, October 18, 2001 9:37 AM
To: zope@zope.org
Subject: [Zope] ZCatalog with OR expression


I'm trying to get an OR expression from a catalog:

For example:

<dtml-in "Catalog(meta_type='Image', title='Z*')">

So, this way I'm having objects with meta_type='Image' AND title starting 
with Z.

Now, I need an OR expression:

I need cataloged objects with meta_type='Image' OR with title='Z*'

This can be done adding "two Catalogs:

<dtml-in "Catalog(meta_type='Image')+Catalog(title='Z*')">

But... this way I get some objects two times: the ones filling both 

How could this be done better?

Thanks if somebody can help...


PS: The real case is more complicated, I'm searching dates between 
ranges... but I think that the problem is the basic solution... Thank you.

Aurki Euskara hutsezko bilatzailea
Zure laguntza behar dugu. Egin zaitez editore!

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-dev )