[Zope] LoginManager dlpierson example

Bill Anderson bill@libc.org
01 Feb 2001 11:03:28 -0700


On 31 Jan 2001 07:05:13 -0600, Fred Yankowski wrote:
> I just realized that I responded in terms of a PythonMethod when you
> asked about a PythonScript.  My ZClass functions for my LoginManager
> subclass are all PythonMethods, yet to be converted to Python
> Scripts.  My 'authenticate' method takes (self, password, request) as
> parameters and has for the function body only
> 
>       return password == self.password
> 
> I suspect that an equivalent PythonScript will need to take password
> and request as parameters (not so sure about 'request') and will have
> a body like this:
> 
>       return password == container.password
> 
> Ah, what the heck...  OK, I just converted my authenticate script as
> above and it seems to still work fine.


A quick 'hack' is that at the top of the Script you can add:
self.=context

:^)=
Bill