[ZPT] Re: [Zope] Using ZPT with options/radio/checkboxes

Chris Withers chrisw at nipltd.com
Fri Aug 8 13:49:35 EDT 2003


[moving lists, so ZPT maintainers can haev a shout :-)]

Ron Bickers wrote:
> 
> Now that we've determined that it's pretty easy to do a checkbox without
> this feature, should it still be used/abused?  Any reason this behavior
> would be removed from a future Zope, or is this a (not well-documented)
> convenience that will stay?

Not sure what you mean, I wasn't aware of the special handling of the two 
attributes already discussed. I think all attributes should be handled the same 
way, that being if the expression evaluates to python's notion of false, then 
the attribute is omitted.

The only situation this doesn't handle is where you want to generate something like:

<myTag needsToBeHere=""/>

...but I think that's enough of an edge case that the following would be acceptable:

<tal:x define="stuff here/getStuff">
<myTag needsToBeHere="something"
        tal:condition="stuff"
        tal:attributes="needsToBeHere stuff">
<myTag needsToBeHere=""
        tal:condition="not:stuff">
</tal:x>

What do other people think?

cheers,

Chris




More information about the ZPT mailing list