--On 10. März 2008 13:55:27 -0700 David Bear <[EMAIL PROTECTED]> 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 toto 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
pgpYVxu6Ow8ib.pgp
Description: PGP signature
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )