Hi there, I keep running into variations of this problem. I want to call an external method and pass the 'self' object (and REQUEST) to it, but explicitly. But still the *current* self. So I have an external method like this: def foo(self, REQUEST): pass The Advanced DTML Howto mentions this: ---- Variable rendering The DTML var tag does not merely lookup variables, but it "renders" them. The process of rendering is not just coercing objects into strings, but calling objects if they are callable, and handling DTML objects specially. Zope's rendering rules are designed to do what Zope thinks is the right way to display an object. However, you may not always want to let Zope render and object automatically. For example, Zope normally renders DTML objects referred to in other DTML objects by calling them the with current DTML namespace stack. ---- And then it goes on how to call it with *other* DTML namespace stacks. But how do I refer to the current DTML namespace stack explicitly? 'self' in DTML doesn't work. Regards, Martijn
At 03:11 PM 8/12/99 +0200, Martijn Faassen wrote:
And then it goes on how to call it with *other* DTML namespace stacks. But how do I refer to the current DTML namespace stack explicitly? 'self' in DTML doesn't work.
Try: def foo(_): return _['somevarfromdtmlnamespace'] And: <!--#var "foo(_)"-->
participants (2)
-
Martijn Faassen -
Phillip J. Eby