[ZPT] variable interpolation
Dieter Maurer
dieter@handshake.de
Fri, 6 Sep 2002 20:42:27 +0200
Lynn Ranen writes:
> Hi -- I think this should be an easy one, but since I'm new to ZPT and to
> Python, I'm beating my head against a wall!
>
> How can I do this? I've tried several syntaxes and none will parse.
> Thansk !! lynn
>
> <globalvars tal:define="global stringarg1 string:Other">
> <globalvars tal:define="global SQL python:'select hours, workdate, heading
> from task where headin
> g = '%s';' % stringarg1">
You either need to use '''...''' as Python string delimiter or
escape the embedded "'".
"... SQL python: 'select ... where heading = \'%s\''"
will work.
> </globalvars>
Are you sure, you want the funny (non standard) tags?
Dieter