[Zope] External Methods and REQUEST

Daryl Tester dt@picknowl.com.au
Fri, 17 Mar 2000 16:05:52 +1030


Michel Pelletier wrote:

> Being explicit.  Also, your method might not (depending on how you use
> it) be being called from ZPublisher (in which case REQUEST is not
> passed, it must be acquired), then again, your method might not be in an
> acquisition context either, in which case you must pass it.  In 99% of
> the cases however, you can do either.

I keep forgetting that Zope is a collection of products :-(.  One day,
I do intend to spend more quality time with the source and how the
components interact.

> Well, hanging is probably not the best way for Zope to handle this
> situation, why it hangs I couldn't tell you

Oddly, it only appears to do that when I call the external method
directly.  If I place <dtml-var "frobnicate(REQUEST)"> (modified to
pass in REQUEST explicitly) into a Method or Document and request
that without parameters, it comes up immediately and correctly.
Odd.

> (perhaps you should post that to the collector).

Will do.

> However, form data usualy comes from a POST, and here your doing a
> GET, passing a query string.

Ahh, differing semantics.  I'm used to Python's cgi.py (and Perl's
cgi.pm, from memory) treating POSTs and GETs with query strings
the same.  The only way of telling the difference was by looking
at the REQUEST_METHOD (if you cared enough, that is).

> You can still get form data that way, the form attribute of REQUEST is
> when you want to make sure you're definatly getting a value from a form
> and not some other namespace.

This was my concern - REQUEST's namespace seems a little crowded, and I
was worried about clashing identifiers.

Hold the phone!  I've just constructed a document that basically does
<dtml-var REQUEST>, and invoked it with a query string, and the
parameters DO show up in REQUEST.form.  Are you pulling the wool over
my eyes, Michel?  :-)

Regards,
  Daryl Tester

PS - The recent "Virtual folders / URL" thread solution you proposed
was _very_ enlightening, but yet reading about direct traversal in
the ZSQL manual didn't provide anywhere near the same lightbulb factor.
Could Digital Creations consider adding that in as an example?