[Zope] Re: Adding attributes to PageTemplateFile

Dieter Maurer dieter at handshake.de
Tue Sep 16 14:47:12 EDT 2003


Josef Meile wrote at 2003-9-16 13:59 +0200:
 > ...
 > If you use it inside the class definition, it will work
 > because "self" it's an instance of the class, so it has
 > access to the class attributes, but if it's outside, like
 > the manage_addForm method, it won't:
 > 
 > _addFooForm=PageTemplateFile('zpt/Foo_Add',globals())
 > _addFooForm._owner=None
 > 
 > def manage_addFooForm(self,*args,**kw):
 >   """manage_addFooForm method"""
 >   kw['Kind']='Foo'
 >   return self._addFooForm(*args,**kw)

Use "_addFooForm.__of__(self)(*args,**kw)".


Dieter



More information about the Zope mailing list