[Zope-CMF] Upgrading to 1.2b1

Alan Runyan runyaga@runyaga.com
Wed, 9 Jan 2002 23:25:54 -0600


NOTE: you do not hand back a object's instance (.  you hand back the objects
id.  thus the comment in the code:
'allow object to munge its own id'.

so.  your Python Script should be very simple:

context.ZClassId.createInObjectManager(REQUEST['id'], REQUEST) #creates the
object
return REQUEST['id'] #return the id for the types tool to grab

the types tool will then get the object from the ZODB using the id returned
back from the constructor.
not quite sure why you changed this.  isnt it the job of a factory to return
instances?  I'm sure you have a good reason.

~runyaga


> alan runyan wrote:
>
> > I'm going from 1.1 to 1.2b1.  The error message is really weird (see
> > previous message).  Here is a hint:  I can create portal objects from
inside
> > the ZMI.  just not from within the CMF interface (invokeFactory).  My
> > ZClasses arent broken.  My portal_types are registered.  Everything
seems to
> > work, but users cant add the custom content objects.
>
> Methods used to construct content instances need to return
>
> the new instance;  the "stock" factory methods don't do this.
>
> The interface for the method used to require returning the
>
> redirection URL;  I changed it to return the object back in
> August, but failed to note it as an issue.
>
> I will add a note to the ISSUES.txt file for the final 1.2
> release.
>
> Tres.
> --
> ===============================================================
> Tres Seaver                                tseaver@zope.com
> Zope Corporation      "Zope Dealers"       http://www.zope.com
>