[Zope] Boolean properties ( Zope 2.5)

Brian Sullivan briansullivan@coursesbywire.com
Thu, 5 Sep 2002 10:20:22 -0400


zope-admin@zope.org <mailto:zope-admin@zope.org> scribbled on Thursday,
September 05, 2002 9:55 AM:

> 
> Ahh, yes, what was I thinking ;-)?! Sometimes it's easy to forget that
> Zope 2.x isn't very "Pythonic" in places. Ok, so if you set a property
> "bool", you can test it like this just fine:
> 
> if context.bool:
>     print "true"
> else:
>     print "false"
> return printed
> 
> If you'd like to poll the property in a form from DTML, try this: 
> <dtml-if bool>
>     <input type="checkbox" name="fooBool" checked /> <dtml-else?
>     <input type="checkbox" name="fooBool" />
> </dtml-if>
> 
> So...you won't know what the actual value of a boolean property will
> be, and it doesn't seem to be "on", either. I hope this answers your
> question...anyone care to explain how PropertyManager handles boolean
> objects? 

Thanks -- that is what I figured out eventually as well -- thought it
was perhaps more "logical" than this.