[Zope-dev] Re: DTML<->Python confusion (RE: [Zope] How to make a script return rendered dtml)

R. David Murray bitz@bitdance.com
Thu, 14 Jun 2001 13:06:43 -0400 (EDT)


On Thu, 14 Jun 2001, Evan Simpson wrote:
> > So why do so many DTML methods / documents have REQUEST as an explicit
> > argument?  It looks like a convention that has to mean something.
> 
> That's just the generic call signature of DTML.  If the callee is to 
> have implicit access to the REQUEST, you have to either pass the REQUEST 
> itself or a proper namespace as the second parameter.   DTML was never 
> really designed to be called with explicit parameters.

You may know this already, but just in case:  there are also a lot
of *python* methods that take REQUEST as an explicit argument even
though they could get it out of self.  In that case it *is* a
convention with meaning: if REQUEST is passed, assume you are being
called through the web (and possibly return a web page or redirect),
otherwise assume a program call and just return.

--RDM