[Zope-dev] BooleanIndex for ZCatalog?

Alexander Limi alexander@limi.net
Thu, 23 Mar 2000 14:43:53 +0100


Hi.

I would like to suggest the following addition to the ZCatalog code: A
BooleanIndex type in addition to the existing FieldIndex, TextIndex and
KeyIndex.

The reason behind this is that Zope stores boolean 1 as "on", whereas a lot
of other sources store them as "True" or simply "1".

I ran into this problem when trying to catalog values that other programs
had set in the ZODB. Some of them appeared as "on", some as "1", and yet
others as "0". The last one was the one causing the trouble, as it was per
Zope definition true, even if the value indicated false.

So, I thought I would suggest that the catalog does some interpreting of the
result when indexing boolean fields, setting the values "off", "0" and
"false" to None, and not just do a pure "index what's contained in the
field" like it does now. This would IMHO best be done with a new Index
called BooleanIndex.

If this sounds totally unacceptable, feel free to ignore my post - I'm a
clueless newbie relaying my initial problems to the zope list as I find them
:)

Regards,


Alexander Limi
PS: CC any answers to me, as I'm not really qualified to be on the
zope-dev-list :)