[Zope] processing dtml in external method

Dieter Maurer dieter@handshake.de
Thu, 24 Aug 2000 00:17:16 +0200 (CEST)


Scott Shepherd writes:
 > I have an external method that returns a string containing dtml, but 
 > I want it to evaluate the dtml and return the result. How do I do 
 > that?
"evaluating dtml" means calling it.

The "__call__" of DTML methods, or, more generally, DocumentTemplates,
has two positional parameters, "client" and "REQUEST",
and an arbitrary number of keyword parameters.

"client" is "None", a single object or a tuple of objects,
"REQUEST" is "None" or a mapping, the keyword parameters
are anything.

The parameters determine, what bindings (i.e. name -> value mappings)
are available in the DocumentTemplate's namespace.
If there are conflicts, the higher priority source wins.
The priority order is as follows (highest priority first):

  * keyword parameters
  * attributes of client
    (I am not sure about the relative priority in the case
     of more than one clients. I believe to remember
     that later clients have higher priority)
  * the mapping.


Dieter