[Zope] Getting a handle on the results of constructors

Dennis Allison allison@sumeru.stanford.EDU
Thu, 18 Apr 2002 03:19:38 -0700 (PDT)


In an External Method (that is, unrestricted python), for example, when
you create a Folder one writes:

   self.manage_addProduct['OFSP'].manage_addFolder( id,title="folder")

one would think that it would return the object it just constructed so it 
would be easy to use the new product to, say, create another folder or a
file inside.   But that appears not to be the case.  (In my example, the 
folder was successfully created but the code

	handle = self.manage_addProduct...

returned None.  That made what I thought was the obvious way to handle
things, namely applying the constructor to the new folder using 

	handle = self.manage_addProduct...

fails as the constructor returns None.  So, how do you get a reference to
the newly created object?