[Zope] passing *args to external method
Dieter Maurer
dieter at handshake.de
Wed Sep 13 14:17:04 EDT 2006
Alan wrote at 2006-9-12 18:26 +0100:
>I've been trying without success to pass from a form in ZPT to an
>external method an undefined list of parameters (*args).
>
>An example:
>
>def external_method(var_fix,*args):
> return 'Vals',var_fix,args
This will not work.
"ZPublisher" must know the argument names to be able to pass values to
them -- for 2 reasons:
1. HTTP uses named request parameters; there is no straighforward
translation into a sequence of positional parameters.
2. The request contains a lot of potentially relevant parameters (beside
the content of "form", we also have "cookies" and "environ" and "self").
Without the names, "ZPublisher" does not know which of them to
pass (even when you function accepts arbitrary keyword parameters).
--
Dieter
More information about the Zope
mailing list