[Zope] DTMLFile question -- half solution

tomas@fabula.de tomas@fabula.de
Thu, 15 Aug 2002 15:24:15 +0200


On Thu, Aug 15, 2002 at 02:34:25PM +0200, Max M wrote:
> tomas@fabula.de wrote:
> 

[...]

> You can passe the dtml class the namespace:
> 
> res.component("foo") # this returns you a class which you then can call.
> 
> res.component("foo")(self, self.REQUEST)

Thanks, that's what I'm trying right now -- still to no avail.
  
  |def component(self, name):
  ...
  |  return eval("self.%s(self, self.REQUEST)" % name)

Thing is...  which `self' to stuff in there. Note that I'm working
from whithin an object method of res -- that is, self is res. I guess
I'll have to pass the ``environment object'' of the DTML (is it
called `context' or something?), which I'll then have to pass
explicitly to 

> >Comments? Ideas? Is there a better way to achieve this? Am I totally
> >crazy?
> 
> Hmmm!

C'mon. Tell me ;-)

Thanks
-- tomas