[Zope] python script parameters
Ben Avery
ben@thesite.org
Wed, 14 Aug 2002 10:28:40 +0100
this worried me a little, I had thought the idea of XML-RPC was that
complex data structures could be passed back and forth, and the XML-RPC
on Zope articles and how-tos only seem to pass simple arguments. So I've
had read around about XML-RPC generally, and it has a number of
different datatypes, including (thank Buddha) Struct, which is
essentially a Python dictionary.
So if your method is a python script which picks up a single parameter,
this can be a single dictionary, allowing you to pass named arguments,
including blank fields, in any position. big :)
maybe I'll write a how-to on this when I have time.
Dieter Maurer wrote:
>Ben Avery writes:
> > I'm having problems with passing a number of parameters to a python
> > script called by XML-RPC.
> > I want some of the parameters to be optional, and passed as empty
> > strings. I have tried to do this by setting default values as empty
> > quoted strings. But playing around even with setting non-empty default
> > values in a list of params doesn't seem to work.
> >
> > e.g.
> > if I set the parameter list of the method as: a, b="aardvark"
> > and then test the script, if I leave b empty, the default aardvark is
> > assumed.
> >
> > but if I switch the order round, and set the param list as: b="aardvark", a
> > and do the same, the script breaks with the error 'the parameter b was
> > ommited from request.
>I am not sure but I fear XML-RPC can only handle positional arguments.
>
>
>Dieter
>
>_______________________________________________
>Zope maillist - Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>** No cross posts or HTML encoding! **
>(Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>