[Zope] a question on external methods

Brian Lloyd Brian@digicool.com
Tue, 16 Feb 1999 17:12:05 -0500


> I can't readily explain why this is the case, but it looks like either
> a) REQUEST is not being passed in, or
> b) REQUEST is None
> 
> The following method:
> def dwName(self,REQUEST=None):                                
>                   
>     if REQUEST is not None:
>         return "%s" % REQUEST['AUTHENTICATED_USER']
>     else:
>         return ""
> 
> will run. It will produce the desired result if called directly
> (by going to the URL of the method). It does not seem to produce
> anything when called from a DTML Method.
> 
> And that's as much as I know :)
> 
> Kevin

If you call it from the web, it will work because ZPublisher will
automatically pass the REQUEST argument. If you call it from DTML,
you have to pass REQUEST yourself:

<!--#var "dwName(REQUEST)"-->



Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com