[Zope] ZCatalog: Why does this work?

Curtis Matthews cmatthews@cpcus.com
Fri, 12 May 2000 10:49:07 -0400


The Advanced ZCatalog Searching HOW-TO on zope.org covers how to query
ZCatalogs for objects within certain ranges of dates, but it only shows how
to do it using bobobase_modification_time. Specifically, to grab items
modified in the last 14 days, it suggests

<dtml-in "Catalog(bobobase_modification_time=_.DateTime(date),
bobobase_modification_time_usage='range:min')">

That's all well and good, but it told me nothing about using ranges with
other date FieldIndexes in ZCatalog. For example, I have a ZCatalog full of
ZClasses with parameter 'date' FieldIndexed. Not expecting this to work, I
tried:

<dtml-in "Catalog(date=_.DateTime()-30, date_usage='range:min')">

...and blimey if it didn't work! What's happening here? Does indexing a date
create a method called {NAME}_usage? If so, how in the world does it do
this?

Just curious,
Curtis Matthews