[Zope] Add an object and subobjects in a single pass?

Florent Guillaume fg@nuxeo.com
Wed, 24 Jul 2002 17:09:54 +0000 (UTC)


VanL  <vlindberg@verio.net> wrote:
> id1, id2 = 'f', 'b'
> 
> f = foo()
> f.id = id1
> f.title = 'Foo Object'
> self._setObject(id1, f)
> f = self._getOb(id1)
> 
> b = bar()
> b.id = id2
> b.title = 'Bar Object'
> self._setObject(id2, b)

you want f._setObject(id2, b)

> b = self._getOb(id2)

and here b = f._getOb(id2)


Florent

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