[Zope] Using external python functions from TAL

Sean Hastings whysean@softhome.net
Thu, 5 Jun 2003 13:34:14 -0400


I have been playing around with TAL, and external python products. I have no
problem calling external python methods on an object using the root
namespace variable "here". as in :

<td tal:content="python:here.foo("></td>

or on some other object that I find through that root. as in:

<tr tal:repeat="object python:here.getObhectsList()">
	<td tal:content="python:object.foo"></td>
</tr>

But I have no idea how to access a random function that is not an object
method.

For example, I would like to be able to have a module called
MyProduct.Functions, containing a function foo(), and call it like this:

<td tal:content="python:MyProduct.Functions.foo()"></td>


How do I get access to this name space?