[ZPT] If/else?

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Thu, 10 May 2001 11:50:09 +1000


Evan Simpson wrote:
> From: <richard@bizarsoftware.com.au>
> > I like these proposed changes to clean things up a little. I was also
> > getting a little concerned about the increasing complexity of things. Is
> > there a wiki page with this stuff on it?
> 
> It's all at
> http://dev.zope.org/Wikis/DevSite/Projects/ZPT/EliminatePathModifiers

This looks really good!

The definition of the '|' operator is missing a statement about the
correctness of the path resolution. Guido's email stated '"x | y | z" will
evaluate to the path x if it is defined and non-empty...' but the wiki page
only talks about evaluating to a 'true value'.


Here's a thought too...

<div tal:condition="python:exists('a/b/c')"
     tal:replace="a/b/c/d" />

... and

<div tal:replace="a/b/c/d | nothing" />

... apear to achieve the same result. Could this spell the death of
tal:condition?

Also, with the tag...

<div tal:replace="python:path('a/b') + 1" />

... the wiki page says that path() will return an error object if the path
doesn't resolve. What will the result of "<error object> + 1" be?


    Richard

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