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

Dianne Van Dulken Dianne.VanDulken@team.ozemail.com.au
Mon, 17 Jun 2002 11:07:35 +1000


I was hoping that I could get some help with this one, without looking too

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 parameter
is a string.  This isn't always the case, in fact, it is rarely the case.  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="script1(var1='blah', var2=['a', 'b', 'c'])"> etc.

I tried calling them like var1:string, var2:list, but I get a syntax error.
Ditto when I try setting types in the parameter list on the script option.
I am using the "python script" default option that comes with zope, as
opposed to importing one.

Any help would be gratefully appreciated.  I am certain there must be some
way, but I haven't been able to discover it myself, and I certainly don't
want to have to start every script with a split on ,