[Zope3-dev] Re: unique intids rationale
j.kartnaller
j.kartnaller at robotech.at
Tue Nov 22 09:19:50 EST 2005
This has already been added to the bug collector :
http://www.zope.org/Collectors/Zope3-dev/466
Jürgen
Jean-Marc Orliaguet wrote:
>
> Hi!
>
> what is the rationale between the unique integer ids utility and the
> usage policy?
>
> more specifically: why are newly added objects registered in *all*
> IntIds utilities? It does not make sense if the utility is registered
> locally. If they are local they should not be concerned with objects
> added elsewhere than outside their "scope".
>
> can it be turned off in the application?
>
> regards
> /JM
>
> .../Zope3/src/zope/app/intid/__init__.py
>
> def addIntIdSubscriber(ob, event):
> """A subscriber to ObjectAddedEvent
> Registers the object added in all unique id utilities and fires
> an event for the catalogs.
> """
> utilities =
> tuple(zapi.getAllUtilitiesRegisteredFor(IIntIds))
> if utilities: # assert that there are any utilites
> key = IKeyReference(ob, None)
> # Register only objects that adapt to key reference
> if key is not None:
> for utility in utilities:
> utility.register(key)
More information about the Zope3-dev
mailing list