[Zope] Passing namespace from DTML to Python Script

Evan Simpson evan@4-am.com
Thu, 24 May 2001 10:03:59 -0400


From: "Chris Withers" <chrisw@nipltd.com>
> I want to call a python script from DTML and pass the namespace, the
trouble is,
> the PS needs to be called from a python expression in DTML.
>
> So, taking the simple DTML method:
> <dtml-var standard_html_header>
> <dtml-let test_thang="'Test Thang'">
> <dtml-var "test_ps" html_quote>

Why the quotes around test_ps?

> </dtml-let>
> <dtml-var standard_html_footer>
>
> ...and a simple python script (with namespace bound to _):
> return _['test_thang']
>
> ..which of coruse, doesn't work, it gives me:
> <PythonScript instance at 01B17ED0>

This should work if you just use <dtml-var test_ps html_quote>.

Cheers,

Evan @ digicool