[Zope] Equivalent of dtml-with in script or ZPT?

Dieter Maurer dieter@handshake.de
Mon, 10 Mar 2003 00:34:17 +0100


Steve McMahon wrote at 2003-3-8 17:09 -0800:
 > Is there a way to achieve in a Python script an effect equivalent to
 > 
 > <dtml-with an_object>
 >    operations in context of an_object
 > </dtml-with>

There is not equivalent to "dtml-with". You must do it explicitly.

 > ? I know it's possible to call the object's methods, but if I need to 
 > pass the methods a context (for example to render a DTML method), I get 
 > the context of the object calling the script, not the context of an_object.

Example:

	dtmlMethod= an_object.method
	dtmlMethod(an_object, an_object.REQUEST)

 > And, for that matter, is there a way to achieve the same effect in a 
 > TALES expression?

Same way....


Dieter