18 Sep
2006
18 Sep
'06
3:09 p.m.
--On Montag, 18. September 2006 06:43 -0700 Ferhat Ayaz <ferhatayaz@yahoo.com> wrote:
Hi,
a quick and newbie question:
How can I call a Script (Python) within a page template. I'm using the 'define' tag:
<tal:contain define="no_matter_var python:context.mycall(myParam)"/>
Is there a more serious way to do this?
Yes, don't do it :-) PageTemplates are "views" and as such not supposed to have sideeffects on application. I'd do it in the application code instead, e.g. before the pagetemplate is called. (Yes you can return the result of a call to a pagetemplate from a python script if you want it easy :-) e.g. python script: doseomething ... return context.thepagetemplate(arg1=var1, ...) Regards Tino