Re: calling a python script from ZPT
Tonico Strasser <[email protected]> Fri, 01 Jul 2005 17:04:17 +0200
| Newsgroups | gmane.comp.web.zope.page-templates |
|---|---|
| Message-ID | <[email protected]> |
Kenneth Gonsalves schrieb:
> hi
> i have a python script called getnames
> i call it like this
> <p tal:repeat="results python:context.getnames(table=tablename)">
>
> now this script is in ploneroot/mainpage
>
> if i call this from the mainpage folder or any sub folder there is no
> problem. But i want to call it from somewhere else in the site
>
> i tried:
> python:${plone_url}.mainpage.getnames()
> and
> python:${plone_url}/mainpage/getnames()
>
> but both dont compile - any clues?
Yes, the expressions above are not valid. Yo are trying to mix a string
expression with a python expression.
Find out more about TALES (TAL Expression Syntax).
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixC.stx#2-40
I don't know what 'plone_url' is, but thanks to Zope acquisition you can
write this as:
Path expression: "here/mainpage/getnames"
or Python expression: "python:here.mainpage.getnames()"
or String expression: "string:${here/mainpage/getnames}"
HTH,
Tonico