--On 10. März 2008 13:55:27 -0700 David Bear <david.bear@asu.edu> wrote:
I'm trying to do something like this in a zpt
<meta tal:define="global target python:here.mysript(request.target) | nothing" />
Please don't invent new syntax (you're mixing Python and TALES expressions). First 'global' variable definitions are usually not needed and considered bad. Use nested scopes instead (as we all do). Second, a tal:condition="request/target | nothing" allows you to to call the block only if target is present within the request. Third you might use getattr(request, 'target', 'default_target') in order to call myscript() with a reasonable default value as needed or use something like this: < meta tal:define="t request/target | string:default_target; target python: context.myscript(t); " /> -aj