[Zope] what about a dtml-python tag ?

Kevin Dangoor kid@kendermedia.com
Mon, 7 Feb 2000 10:12:20 -0500


----- Original Message -----
From: "Jerome ALET" <alet@unice.fr>
To: <zope@zope.org>
Sent: Monday, February 07, 2000 9:47 AM
Subject: [Zope] what about a dtml-python tag ?


> Hi there,
>
> first excuse me, if this idea looks stupid just delete this message:
>
> what about adding a new dtml tag called dtml-python useable this way:
>
> <dtml-python mypythonmodule>
>
>   def myfunc(param) :
> return param * 3
>
>   def anotherfunc(p1, p2)
> return str(myfunc(p1)) + ' ' + str(myfunc(p2))
>
> </dtml-python>

Ahhhh!!! PHP!!! AHHH!!

Seriously, though, I think this isn't something generally desirable, because
it's good to separate out program logic from display logic and layouts. DTML
works good for display logic... python works better for program logic.

Have you seen PythonMethods? They allow you to write methods in Python
through the web. They have all of the same safety restrictions as DTML.
(External Methods still have their uses, because they are completely
unrestricted python.)

Kevin