[Zope-dev] Re: [Zope-PTK] Fw: PythonMethods and ZClass generation problem

Shane Hathaway shane@digicool.com
Thu, 18 Jan 2001 16:10:37 -0500


Alexander Limi wrote:
> 
> From: "Shane Hathaway" <shane@digicool.com>
> 
> > You were *SO* close. :-)
> >
> > I think you want this:
> >
> > return self.artists.manage_addProduct['Artist'].Artist_add(_.None,_)
> >
> > to be like this:
> >
> > return
> > self.artists.manage_addProduct['Artist'].Artist_add(_.None,_,REQUEST)
> 
> Tried both of those already. When testing it, and Artist_add contains
> nothing but "<dtml-var REQUEST>" (so nothing else can be wrong), I get:
> 
> KeyError: REQUEST
> 
> and the traceback looks like this:
> 
> File <string>, line 41, in registerartist (Object:
> ApplicationDefaultPermissions)
> File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 168, in __call__
> (Object: Artist_add)
> File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 528, in
> __call__ (Object: Artist_add) KeyError: (see above)
> 
> Thanks for you suggestions so far,

Oh, wait a minute, I see what's going on now.  Try this:

return self.artists.manage_addProduct['Artist'].Artist_add(self,
self.REQUEST)

Shane