[ZPT] TAL Exists: type

Todd Coram todd@digicool.com
Wed, 21 Mar 2001 11:08:41 -0500


If exists: checks for the existence of objects (derived from paths), how do
we distinguish "hard" traversal errors from "soft" ones? What does it mean
to say "testing for whether and object exists or not" when traversal is
dynamic? What if the act of traversal causes behavior (hit count increment,
random redirection, etc)?

Martijn's example:

> <div tal:condition="exists:request/statusMessage"
>      tal:content="request/statusMessage">
>      The optional status message will be displayed here
> </div>

is on the mark. This is a fairly simple traversal with obvious semantics.
But, how about:

<div tal:condition="exists:here/yourCountry/yourState/yourCity/zopeContact">

Okay, so this could return true if your "home" city has a zope contact
person, otherwise false if there is no zope contact in that city.  But, what
if there is a traversal error (i.e. calling one of the elements results in a
"system" error)? Maybe "yourState" is broken.  What is the correct behavior?
Does exists: catch exceptions and silently return false?

-- todd