[ZPT] Possible changes to path-related

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Tue, 01 May 2001 15:02:19 +1000


Evan Simpson wrote:
> > Do you have a use case for the above definition of the behaviour of
> "if request/foo"?
> 
> Suppose you has a ZClass which had properties to control the rows,
> columns, and content of a textarea.  The rows and columns properties
> always exist, but if they are blank (false) you want to omit the
> textarea attributes, or leave them set to some default.  Not critical,
> but plausible, I think.

Valid :)


> > Also, lazy: didn't care about the actual value returned - this is
> important
> > for the example above if the request has an empty string value in it
> 
> That's 'if exists'.  It only cares if the path exists.  If you care
> about the value, you use 'if'.

Sorry, my understanding of the summary you posted was that 'if exists'
cared about the value. No problems if it doesn't though (and having looked
at the code now, I know that it doesn't :)



> >    <input type="checkbox" tal:condition="(if) request/form/foo"
> CHECKED>
> >    <input type="checkbox" tal:condition="(if) not:request/form/foo">
> 
> I think that you want the form:
> 
> <input type="checkbox" tal:attributes="checked (if exists)
> request/form/foo">

Will give this a try.


> > p.s. The zpt mailing list archive is still broken... Any hope of a fix
> there?
> 
> I'm not sure what's going on there; I'll ask our list admin.

That would be great - it's pretty much the only way I catch up with what's
going on on the list while I'm not at work. I should just subscribe at home
too.


   Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)