On Wed, Jul 20, 2011 at 09:52:26AM -0700, Mike Orr wrote:
> * HTML 5 has a lame-brained definition of boolean attributes. If the
> attribute has any value including '', it's true. To make the attribute
> false you have to remove it completely. That's impossible to express
> in a 'kw = value' expression, so you'd have to have something
> higher-level than that.

You could have a convention that attributes specified as 'kw = value'
expressions are omitted from the output when the value evaluates to
None.  Zope Page Templates act like that, allowing one to write things
like

  <input tal:attributes="disabled python: 'disabled' if is_disabled else None"
         ... />

Marius Gedminas
-- 
Five words to strike fear into the heart of any software developer: 'How long
will it take?'
                -- Sean McGrath

Attachment: signature.asc
Description: Digital signature

Reply via email to