[Zope] ZPT and Python Product

Dieter Maurer dieter@handshake.de
Wed, 3 Apr 2002 23:58:01 +0200


Thomas Guettler writes:
 > I have a problem with ZPT and a Python Product.
 > 
 > I set the page template like this:
 > class myClass(Folder):
 >      StandardTemplate=PageTemplateFile('StollDMS-www/StandardTemplate', globals(),
 >                                        __name__='StandardTemplate'))
 > 
 > it works to use TAL. But it fails if I try to define a macro.
 > 
 > I get:
 > Error Type: TALESError
 > Error Value: exceptions.NameError on global name 'aq_parent' is not
 > defined in "standard:'container/StandardTemplate/macros/page'", at line 1, column 1
Looks like a bug in the code.

Check the last lines of the traceback.
Check whether the referenced source line contains an "aq_parent".
It so, probably a "from Acquisition import aq_parent" is missing.


Dieter