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> <dtml-var mypythonmodule.anotherfunc(3,9)> this would allow to embed python code in dtml files without having to create external methods. I really don't know if this could be useful (I've not used external methods for now) or if it is feasible, I'm simply surprised that this sort of tag doesn't seem to exist. bye, Jerome ALET - alet@unice.fr - http://cortex.unice.fr/~jerome Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE
You may be interested in the following link: http://www.zope.org/Members/4am/PythonMethod ----- Original Message ----- From: Jerome ALET <alet@unice.fr>
what about adding a new dtml tag called dtml-python useable this way:
<dtml-python mypythonmodule>
----- 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
participants (3)
-
Evan Simpson -
Jerome ALET -
Kevin Dangoor