[Grok-dev] Re: Keeping indexes up to date

Philipp von Weitershausen philipp at weitershausen.de
Fri Aug 10 05:30:34 EDT 2007


Luciano Ramalho wrote:
> Kirbi now uses an XML-RPC interface to receive updates for its book
> records (previously XML-RPC was used only for adding new book
> records).
> 
> However, I noticed that when the Book instances are updated via
> XML-RPC, the catalog does not reflect the update. It seems an event is
> not firing when it should.

The rule of thumb about events is this: "Whoever does something to an 
object should also send the event."

That means if you modify an object, you should be sending an 
IObjectModifiedEvent. If you create an object, you should send an 
IObjectCreatedEvent, etc. As Tres already mentioned, this typically 
happens in a view. Form views already do it for you, that's why haven't 
had to do anything so far.

Note that the two container events, IObjectAddedEvent and 
IObjectRemovedEvent, are already sent by container operations and 
needn't be sent by you.


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Grok-dev mailing list