Re: Pass parameters in tal expression
"Dieter Maurer" <[email protected]> Wed, 19 Nov 2008 20:17:31 +0100
| Newsgroups | gmane.comp.web.zope.page-templates |
|---|---|
| Message-ID | <[email protected]> |
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