Mayers, Philip J writes:
 > def extmethod(self, REQUEST):
 >      return str(REQUEST)
 > >From the web that prints the string Representation of REQUEST. But, over
 > XMLRPC, this:
 > s=xmlrpblib.Server("")
 > s.path.extmethod()
 > Returns the string representation of REQUEST, but *this*
 > s.path.extmethod('rrr')
 > return 'rrr'. What's happening?
That's the ZPublisher magic:

  it tries to match the requirements of the called object
  with what is provided by the request.

  In your first example, you did not provide a parameter,
  but your function requires one. ZPublisher determined
  the "REQUEST" object as candidate based on the parameters

  In your second example, you did provide a parameter.
  ZPublisher used this positional parameter to satisfy
  the first positional parameter of your function.

  Thus, if your function requires two parameters: say
  'text' and 'REQUEST', your second example would
  behave as your first now does.

There is a document on that describes this
ZPublisher magic in more detail.
But maybe, you already know enough to fulfill your


Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to