[Zope3-dev] Calling persistent function

Jim Fulton jim at zope.com
Thu Jan 22 06:04:32 EST 2004


Danny Smith wrote:
> I figured out how to add a persistent module to the
> site manager but not how to call a function in it from
> a page template.  The expression:
> 
> <span tal:content="python:
> container.getSiteManager()['default'].resolve('foo.bar')"
> />
> 
> will correctly resolve the bar function in the module
> foo, but when I try to call it I get
> ForbiddenAttribute __call__.
> 
> I'm just playing around, is it possible to call a
> persistent function from a page template?

Not yet.  They aren't really meant for this sort of use.
They exist mainly to:

- Be imported into other modules

- Registered as components.

For example, you should be able to register opersistent
functions and classes as adapters.

This is all pretty raw and experimental at this point.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




More information about the Zope3-dev mailing list