[Zope] Adding a ZClass instance in python

Dieter Maurer dieter@handshake.de
Fri, 31 Aug 2001 18:37:34 +0200 (CEST)


Gilles Lenfant writes:
 > context.REQUEST.set('id', myNewId)
 > context.manage_addProduct['MyProduct'].MyZClass_add(_.None, NoRedir=1)
 > return 'Done'
Use:

   my_context= context.manage_addProduct['MyProduct']
   my_context.MyZClass_add(my_context,context.REQUEST, NoRedir=1)

and please keep in mind:

   *WHENEVER* you call a DTML object explicitely (i.e. other
   than within DTML "name" parameters), you *MUST* pass in
   the correct context.
   There is no longer any magic, that does it for you.


Dieter