[Zope-dev] [BlueBream] Reg. updating catalog indexes in bluebream

Joshua Immanuel josh at hipro.co.in
Fri Jun 24 05:54:52 EDT 2011


On Fri, 2011-06-24 at 00:12 +0200, Thierry Florac wrote:
> You don't have to subscribe to IContainerModifiedEvent or
> IObjectModifiedEvent: zope.intid and zope.catalog packages already
> provide subscribers for these events to automatically handle updates
> of indexes.
> 
> What you have to do is just to generate an ObjectAddedEvent or
> ObjectModifiedEvent when your object is added or modified, and notify
> subscribers for it:

When I add my object to its container via zope.formlib AddForm's
createAndAdd method like this

        cl = Client()
        ...
        self.context[cid] = cl
        
(P.S: I didn't explicitly notify the ObjectAddedEvent.)
        
In setitem function of zope.container.contained
'notify(ObjectAddedEvent)' happens, this causes the 'addIntIdSubscriber'
adapter of zope.intid to be called. This in turn registers the 'Client'
object and notifies for 'IntIdAddedEvent'. 

But I don't see the 'indexDocSubscriber' of zope.catalog.catalog which
is the adapter for 'IIntIdAddedEvent' being called. Why is this so?

So, sm['intids'] is getting updated as and when new objects are added
but the catalog indexes are not getting updated. Am I missing something?
Or is there any specific zcml configuration needed for this? 

Please guide me.

-- 
Joshua Immanuel
HiPro IT Solutions Private Limited
http://hipro.co.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20110624/1f438d57/attachment.bin 


More information about the Zope-Dev mailing list