[Zope] External Methods and REQUEST

Daryl Tester dt@picknowl.com.au
Fri, 17 Mar 2000 13:53:14 +1030


Greetings,

I've started having a serious fiddle with External Methods, and have
run across a couple of brain issues:

1)  Most examples I've seen (well, both :-) pass REQUEST as a parameter
in addition to self (for example, def frobnicate(self, REQUEST)).  Yet
I've noticed that I can pull REQUEST out of self's namespace, and they
appear identical.  Is there a reason for passing in REQUEST explicitly?

2)  (And if this is related to point #1, then you may beat me around the
head with a Nerf bat).  I defined an external method called frobnicate
as follows:

def frobnicate(self):
    "One of many test functions"
    return self.REQUEST.form

and install it.  If I call it with http://localhost/zope/frobnicate?foo=bar
it returns a dictionary of {'foo' : 'bar'}, as it should.  If I call
it without any arguments as http://localhost/zope/frobnicate the
browser hangs and eventually times out with "The document contained no
data".  I'm specifically interested in form data here, which is why I
haven't used the REQUEST['thingo'] idiom, so I suspect I must be
accessing REQUEST incorrectly.  Any clues would be most welcome (if
only someone could write a ZenOfZope product; I'd download it into my
brain in an instant! :-)


Regards,
  Daryl Tester