[ZPT] Pass parameters in tal expression

Dieter Maurer dieter at handshake.de
Wed Nov 19 14:17:31 EST 2008


Chintan D Parikh wrote at 2008-11-17 12:03 -0600:
>I'm trying to pass parameters that are fetched and displayed from database
>thru tal:repeat, in order to sent emails.
>
>Here is the code snippet:
>
><tr tal:repeat="record container/map-db/alert_subscription_mstQ">
><td tal:define="emailflag python:
>context/map-db/alert_subscription_mstS'(record)"
>tal:content="emailflag">Failure</td>
>
>Here the alert_subscription_mstQ is a Z SQL Method that fetches records
>based on my set criteria. It returns 6 columns, values of which i need to
>show on the page and also pass them to the alert_subscription_mstS python
>script to sent emails.
>
>I later learned that passing parameters in expressions is not allowed. Can
>someone suggest me an alternative.

Try:

   <td tal:define="emailflag python:
      context.restrictedTraverse('map-db/alert_subscription_mstS')(record)"
      ....



-- 
Dieter


More information about the ZPT mailing list