The current object manager code allows for three kinds of subobjects:
unique -- prevents the creation of an object with the same name as one
that is in the current object manager or one that is acquired. This is
what Steve was talking about. It's signified by the acquired object
having a __replaceable__ = Globals.UNIQUE value.
not replaceable -- the default. if you ask an object manager to store a
subobject of the same name as one it already contains, and the existing
object has no __replaceable__ attribute or has a __replaceable__
attribute that == Globals.NOT_REPACEABLE, the object manager raises a
replaceable -- if you ask an object manager to store a subobject of the
same name as one it already contains, and the existing contained
object's __replaceable__ attribute is set to Globals.REPLACEABLE, the
call will succeed and the new object will replace the old one.
Chris Withers wrote:
> Ivo van der Wijk wrote:
>>First of all, is allow_dup ever set to true?
>>Does zope support
>>duplicate id's in an ObjectManager anywhere at all?
>>Secondly, can someone give me an example of a Replaceable object?
> If a class defines a PUT_factory method, this may be set as replaceable so that
> someone can override it by dropping a Python Script or External Method called
> 'PUT_Factory' into the ObjectManager.
> This is the case for the CVS version of the Skins tool in CMF...
> Zope-Dev maillist - [EMAIL PROTECTED]
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope )
Chris McDonough Zope Corporation
"Killing hundreds of birds with thousands of stones"
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -