[Zope-dev] masquerading python products as functions
Dieter Maurer
dieter@handshake.de
Wed, 11 Jul 2001 21:01:53 +0200 (CEST)
Mick writes:
> I am trying to make a product act like an external method, or dtmlmethod.
> Basically I have taken the minimal product and added a __call__ function.
> It works fine, and can be called as a function of the object that contains
> it. The problem is that the minimal objects namespace is also pushed onto
> the stack, and to get out of it I need to go through self.aq_parent.
> Reading though all the help I could find I tried adding the following (as
> DTMLMethod suggests.)
>
> #Documents masquerade as functions
> class func_code: pass
> func_code=func_code()
> func_code.co_varnames='self','RQUEST','RESPONSE'
> func_code.co_argcount=3
This only affect the ZPublisher (more precisely "mapply").
What you may need: "isDocTemp".
Search the mailing list archives for it.
Dieter