[Zope-CMF] Upgrading to 1.2b1

Florent Guillaume fg@nuxeo.com
Sun, 27 Jan 2002 22:54:45 +0000 (UTC)


Alan Runyan <runyaga@runyaga.com> wrote:
> NOTE: you do not hand back a object's instance, you hand back the object's
> 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

It's even simpler to return nothing (ie None), as the Types Tool takes
that as meaning "use the original id".

It's only for Scriptable Types that you need to return the created object.

(As a matter of fact, why this difference ?)


Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:fg@nuxeo.com