[Zope] Python access to dtml-let vars

Charlie Reiman creiman@kefta.com
Mon, 13 May 2002 17:30:32 -0700


Forgive me if this is a stupid question but I'm still finding Zope's
numerous namespaces confusing.

I want to have a DTML method that has this in it:

<dtml-let var1="'avalue'">
<dtml-var myscript>
</dtml-let>

And a python script call myscript that does something like:

print mysterious_voodoo.getitem('var1')

The right text for mysterious_voodoo eludes me. How do I access dtml-let set
variables from a python script context? Is it possible?

Passing the argument as a named keyword is something I want to avoid as
there is a security issue with allowing users to type in URLs like

http://blah/myscript?var1=evil_hacker_string

As far as I can tell, there isn't a way the python script can tell if it was
called directly via a URL or via the enclosing document. So I'd like to make
sure it pulls its parameters from the DTML namespace stack.