[Grok-dev] indexes not getting updated for contents added via ApplicationInitializedEvent subscriber
josh at hipro.co.in
Mon Nov 26 09:29:33 UTC 2012
I was trying to add some default contents for my application upon the
initialization of Site. So, I added a subscriber for
ApplicationInitializedEvent. In that subscriber I tried adding an object
which has some indexes attached with it. Though the object gets added
successfully but the catalog indexes for it are not getting updated.
However, the indexes are updated if the object is added via formlib.
Upon searching the archives I found this thread which talks about the
This is how my subscriber looks like
def cbAppRootAdded(app_root, event):
catalog = component.queryUtility(ICatalog, context=app_root)
# catalog is not None
intids = component.queryUtility(
IIntIds, context=app_root, default=None)
# intids is also not None
my_folder = MyFolder() # grok.Container object
my_default_object = MyObject(...) # grok.Model object
my_folder['default_object'] = my_default_object
app_root['my_folder'] = my_folder
I even tried adding the default object via IObjectAddedEvent subscriber
for IMyFolder. Still, the indexes for MyObject were not getting updated.
Am I missing something?
HiPro IT Solutions Private Limited
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the Grok-dev