[ZPT] how do I test the existence of a variable?

seb bacon seb@jamkit.com
21 Mar 2002 11:23:06 +0000


I need to see if a variable has been set in the current namespace.  A
(silly) example:

<span tal:define="foo python:42">
  <b tal:condition="exists:currentnamespace/foo">Foo exists</b>
</span>

In other words, I need the above to work whether or not the enclosing
<span>s are present.

How do I access the current namespace?  It's not appended to *request*
or *here* or similar, AFAICT.

seb