Johan Carlsson wrote:
Dominik Huber wrote:
Your problem is that the catalog is not locatable itself during the
addition of its indexes (-> state within the create and add method),
therefore the location of the indexes cannot be located and the
NotYetError is raised. You can move your code to an
ObjectAddedEvent-subscriber for your object.
handler pseudo code:
def addCatalogAndIndex(obj, event):
sm = zapi.getNextSiteManager(obj)
catalog = Catalog()
addLocalUtility(sm, 'XY', ICatalog, catalog)
catalog[name] = Index(name, IAnyInterface)
I've tried this, it doesn't remove the NotYet problem though!??
Our framework relies on that concept and it is still working ;)
Did you assert to add the catalog to the sitemanagement folder before
adding its indexes?
tel;work:++41 56 534 77 30
Zope3-users mailing list