[Zope] DTML batch processing w/external method
David Chandek-Stark
chand012@mc.duke.edu
Tue, 15 Apr 2003 09:47:18 -0400
Here's the external method:
#
from xmlrpclib import ServerProxy
def directory(skip, max):
s = repr(skip)
m = repr(max)
server_url
= 'http://www.lib.duke.edu/texis/xmlrpc/directory/main.xml?skip='+s+'
&maxrecs='+m
server = ServerProxy(server_url)
return server()
#
It works fine when DTML passes literals:
<dtml-try>
<dtml-in expr="directory(0,25)" mapping>
<dtml-if sequence-start>
<table>
</dtml-if>
<tr>
<td><a href="http://www.lib.duke.edu/texis/directory/staff.html?id
=&dtml-ID;"><dtml-var Person></a></td>
<td><dtml-var Phone></td>
</tr>
<dtml-if sequence-end>
<table>
</dtml-if>
</dtml-in>
<dtml-except Fault>
XML-RPC Error!
</dtml-try>
Thanks,
David
_____________________________________
David Chandek-Stark
Dept. of Web Services - Perkins Library, Duke University
E-mail: d.chandek.stark@duke.edu
Voice: 919.660.5859
Fax: 919.684.2855
Dylan Reinhardt
<python@dylanrein To: David Chandek-Stark <chand012@mc.duke.edu>
hardt.com> cc: zope@zope.org
Subject: Re: [Zope] DTML batch processing w/external method
04/14/2003 05:43
PM
Please respond to
python
On Mon, 2003-04-14 at 14:01, David Chandek-Stark wrote:
> <dtml-in expr="external_method(start,size)" ...>
>
> doesn't work (NameError: global name 'start' is not defined).
The DTML looks OK. Care to post the external method code?
Dylan