[Zope] Newbie: need a simple example of external method

Dan Rusch drusch@globalcrossing.com
Wed, 13 Oct 1999 15:56:04 -0500


This example shows how to call an external or an internal python method.
The method convertDate(date) is located in a folder named utils off of
the root.

Technique 1:
<!--#call "REQUEST.set('ThisDate',utils.convertDate(date))"-->
Date is:&nbsp;<!--#var ThisDate -->&nbsp;<br>

Technique 1 allows for the return value to be "stored" in a variable

Technique 2:
Date is:&nbsp;<!--#var "utils.convertDate(date)"-->

Technique 2 simply uses the return value.

Of course if your method doesn't return anything (called only for it's
side effect) then technique 2 is modified to:<!--#call
"utils.convertDate(date)"-->

Hope this helps,

DR