[Zope] Mixing DTML and Python scripts

Dylan Reinhardt zope@dylanreinhardt.com
25 Mar 2003 10:14:52 +0000


On Mon, 2003-03-24 at 09:05, Thierry FLORAC wrote:
> Are there any drawbacks to mix DTML methods and Python scripts, calling each 
> other, instead of keeping "pure" DTML methods ??

I would say that mixing DTML and Python is how DTML *should* be used. 
DTML is a great tool for templating and for calling other Zope
objects... it is typically the wrong tool for significant logic.  

Ideally (IMO) DTML should do little more than grab a dictionary and
insert its values into a template.  DTML's branch and loop constructs
should only be used to the degree that they are necessary to correctly
render an interface.

As for "calling each other" you'll probably see the best results if
you're using DTML to call Python, not vice versa.  It's usually easier
to maintain stuff set up this way.

HTH,

Dylan