ZDG bug (was: [Zope] Obj created in ExtMethod give "not allowed to use in this context")

Dieter Maurer dieter@handshake.de
Sun, 28 Jul 2002 23:42:02 +0200


Joel Burton writes:
 > I have an External Method that creates a Formulator BasicForm on the fly and
 > returns it to a calling PageTemplate:
 > 
 > from Products.Formulator import Form
 > 
 > def make_form(self, origform, addlist):
 >     """Make form on the fly"""
 >     nf = Form.BasicForm()
 >     nf.add_fields( [ field
 >                      for field in origform.get_fields()
 >                      if field.getId() in addlist ] )
 >     return nf
It should return an acquisition wrapped object. Try:

       return nf.__of__(self)


This is wrong in the ZDG. Please fix it (through a comment for it).


Dieter