--On Montag, 18. September 2006 06:43 -0700 Ferhat Ayaz <[EMAIL PROTECTED]> 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
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to