[Zope-CMF] how to get the object created by invokeFactory

Chris Withers chrisw@nipltd.com
Tue, 03 Jul 2001 15:18:50 +0100


seb bacon wrote:
> 
> So, if I call invokeFactory(id), I can't necessarily know what the id
> actually was, so I can't grab the object to edit it.  Wouldn't
> something like this avoid the code duplication problem you mention:
> 
>   def __init__(self, id, **kw):
>       # blah
>       self._getOb(id).edit(**kw)

Well, that's still unnecessary (and therefor bad, yes I am a facist ;-) code...

What would solve the problem properly is for invokeFactory to return the new
object. If it doesn't already, ti should ;-)

cheers,

Chris