[Zope] passing parameters from dtml-method to Script (Python)

Satchidanand Haridas sharidas at zeomega.com
Tue Jul 13 02:43:26 EDT 2004


Hi,

A work around to your problem is using <dtml-let>:

<dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD">
   <b><center>
      <dtml-let result="gimmeBack(a=pid,b=bid)">          <dtml-var result>
      </dtml-let>
   </center></b>
</dtml-let>

But this is a work around and there might be a better solution. For a 
response on a similar problem, check this posting on the Zope mailing list:

http://mail.zope.org/pipermail/zope/2002-September/122617.html


Regards,

Satchit
ZeOmega Infotech Pvt Ltd,
http://www.zeomega.com


R Karthick wrote:

>Hi!!!
>
>I am relatively a newbie to zope, this might b jus
>another newbie question. but i am really stuck in
>this.
>
>I have a dtml-method which does the following
>
><dtml-let pid="getProjectIdMTD" bid="getBatchIdMTD">
>    <b><center><dtml-var expr="gimmeBack(a=pid,
>b=bid)"></center></b>
></dtml-let>
>
>--
>
>getProjectIdMTD and getBatchIdMtd are just script
>python methods, which return simple strings. they jus
>do 
>
>return "foo"
>
>--
>
>return "bar"
>
>--
>
>Now when i call the function gimmeBack(a=pid,b=bid),
>the pid and bid are not passed into the function. I am
>able to <dtml-var pid>, and it shows the value of pid.
>
>foo
>
>my gimmeBackMtd has 
>
>return a
>
>No matter how i tried, I am just not able to make it
>work. But when I assign pid and bid with strings like
>
><dtml-let pid="'foo'" bid="'bar'">
>
>it works. Doesnt Script Python function return strings
>even if they appear to?
>
>Please help!!!
>
>Regards,
>R K
>
>=====
>with "freedom" comes great responsibilities
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>New and Improved Yahoo! Mail - 100MB free storage!
>http://promotions.yahoo.com/new_mail 
>_______________________________________________
>Zope maillist  -  Zope at 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 )
>  
>



More information about the Zope mailing list