[Zope] Searching for a 'true' boolean in a Catalog

Michel Pelletier michel@digicool.com
Thu, 15 Jul 1999 17:42:52 -0400


> -----Original Message-----
> From: Kevin Dangoor [mailto:kid@kendermedia.com]
> Sent: Thursday, July 15, 1999 5:03 PM
> To: zope@zope.org
> Subject: [Zope] Searching for a 'true' boolean in a Catalog
> 
> 
> This has got to be an easy one, but it is eluding me... if I have
> indexed a boolean property in a Catalog, how do I search for 
> cases where
> that property is true?
> 

A DTML Method in the Catalog to find all objects with the boolean
property 'property' that are true:

<!--#in searchResults(property='on')-->
  <!--#var id-->
<!--#/in-->

This is because HTML checkboxes, which are typicly represent boolean
properties, are controlled with the strings 'on' and 'off'.

Yes I know that this is slightly lame because both strings evaluate to
true in Python, but that's the way it's allways been.

-Michel

> Thanks,
> Kevin
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>