[Zope] Passing not-string variables to a python script

Bakhtiar A Hamid kedai@kedai.com.my
Mon, 17 Jun 2002 10:00:10 +0000


On Monday 17 June 2002 01:07 am, Dianne Van Dulken wrote:
> Hi,

> I'm finding whenever I call a python script from within a zope page (as
> opposed to submitting a form to a script), it assumes that every parame=
ter
> is a string.  This isn't always the case, in fact, it is rarely the cas=
e.=20
> I was wondering if there was anyway that I could force it to know what =
type
> it was.  I am particularly interested in passing in lists.
>
> The way I call it at the moment is like this:
>
> <dtml-var expr=3D"script1(var1=3D'blah', var2=3D['a', 'b', 'c'])"> etc.
>

on zope2.5.1, i do get the necessary objects.=20
e.g

dtml-method
<dtml-var standard_html_header>
<h2><dtml-var title_or_id> <dtml-var document_title></h2>
<p><dtml-var expr=3D"te(a=3D'string',b=3D['1','a'])">
</p>
<dtml-var standard_html_footer>

script python=20
#parameters a, b
return a,b

gives me=20
('string',['1','a'])
which is right

hth

--=20

=09http://www.kedai.com.my/             http://www.kedai.com.my/eZine
=09http://www.zope.org/Members/kedai    http://www.my-zope.org
=09If you SMELLLL...=20