--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 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);
                  " />


Attachment: pgpYVxu6Ow8ib.pgp
Description: PGP signature

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to