[ZPT] Passing "options" keyword arguments to a PageTemplateFile?

Evan Simpson evan@4-am.com
Fri, 14 Feb 2003 17:07:06 -0600


Jon Whitener wrote:
> Whether I use "container", "here", "template", I get the same
> Attribute error because Zope apparently isn't looking in the 
> MinimalModule.  Any further ideas would be like gold to me.
> 
> MinimalModule.py:
> -----------------
...
>     def get_categories(self):
>         " Return a list of categories "
>         return ['Arts', 'Culture', 'Family']
> 
>         index_html = PageTemplateFile('www/index_html', globals())

I'm presuming something funky happened to the indentation of your module 
when you pasted it into your posting, since the 'index_html' assignment 
should certainly not be inside get_categories().

Attribute access in PageTemplateFiles is subject to security 
restrictions, so you'll need to declare get_categories() public, or give 
it the same permission as your index_html.

Cheers,

Evan @ 4-am