This is definitely possible. You probably have a faulty factory method. In Zope, construction is a two step process that looks something like

 def addSomething(self, id, title=''):
     ob = Something(id, title)
     self._setObject(id, ob)

An ObjectManager must know the ids of its subobjects and stores them in the _objects attribute.

Hm, _setObject() returns the id the object was actually added to the OM with. I think it is allowed to return a different id from the one which got passed in (but it never does that as far as I can tell).

Hope this helps,

--On Mittwoch, 11. Juni 2003 20:13 +0200 Romain Slootmaekers <[EMAIL PROTECTED]> wrote:

I have an error in this code fragment:

-------------  fragment ----------
for childObject in container.objectValues():
     childObject2=container[id] # sometimes gives a KeyError ????
------------- /fragment ----------

So it means that there are contained objects with an getId member that
returns something different than the key that is used for these objects
in the container object.

As it turns out, I indeed have such objects in my ZODB, and they cause
all kinds of problems (fe, you can't rename them with the management

The questions are:
   - has anyone else experienced this ?
   - what could be causing this ?

The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is.               /Pete McBreen/

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to