[Zope] Catalog and greater then less than

Martijn Pieters mj@antraciet.nl
Wed, 22 Sep 1999 16:28:26 +0200


At 22:49 21/09/99 , Jason Spisak wrote:
>Zopists,
>
>Isthere a way to search for a value in the Ctalog that is greater
>than/less then a given value (Especially dates) <> don't work and so I
>guess its not regular expression syntax.  The only mention of greater
>than in the docs is ceil(X), and that's not quite it.
>
>Any suggestions apprecreciated.

If your datefield is called date, use:

   Catalog.searchResults({'date': [ZopeTime()], 'date_usage': 'range:max'})

to get all objects with a 'date' value of maximum 'ZopeTime()'. For 
anything later than a given date, use :min instead, and if yo uspecify a 
list of dates, and specify 'range:min:max' then the highest and lowest 
values of your list will be used as boundaries.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------