[Zope-dev] least hacky way of cataloguing multiple dates

Steve Alexander steve@cat-box.net
Thu, 23 Nov 2000 23:23:16 +0000


Andy McKay wrote:

> I have multiple dates in a field as lines. What I would like to do is call
> objects queried on those dates... this seems very flaky has anyone tried
> this? The best result so far is to hack the date in a string the text index
> likes such as Date2000-10-11.... ugghh. I can then query the text index.

Untested:

Make a method that returns a list of DateTime objects. You'll probably 
want to use a PythonMethod or an External Method.

Set your ZCatalog up to index these as a KeywordIndex.

Then, query the ZCatalog as you would normally query a ZCatalog with a 
KeywordIndex, but ensure that you are using DateTime instances as your 
constraints in your query.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net