[Zope] return value treated as dtml?

Dylan Reinhardt zope at dylanreinhardt.com
Fri Oct 24 00:51:11 EDT 2003

On Thu, 2003-10-23 at 18:02, Ted holden wrote:
> Is it possible to have an external method return a string which would be 
> treated by zope as a dtml page, i.e. to have the return string contain dtml 
> commands which would execute?

Possibly... but it wouldn't be easy and it's hard to imagine why it
would be necessary or desirable.

You can pass parameters to DTML (or better yet, Python) and you can call
arbitrary methods/names from the DTML namespace.  Between these two
abilities, you should be able to code up just about anything.  

If that's not hard-core enough, Python is perfectly capable of executing
self-generated code:

>>> exec 'a = "hello world"'
>>> a
'hello world'

You'd need to do that in an external method or product.  You may wish to
look up the compile and eval statements if you plan on doing this

Perhaps you could provide an example of the problem you're trying to
solve & we can take a whack at the easiest way to solve it?


More information about the Zope mailing list