I can add a tool which is a simple subclass of Catalog.
However if I try to add some index(es) in the constructor it fails with a NotYet error (see below).

Is there a simple way to achieve this?


from zope.app.catalog.interfaces import ICatalog
from zope.app.catalog.catalog import Catalog
from zope.app.catalog.text import TextIndex

class IFoodCatalog(ICatalog):
    pass

class FoodCatalog(Catalog):
    implements(IFoodCatalog)

    def __init__(self):
        super(FoodCatalog, self).__init__()
        #this fails
        #self['title'] = TextIndex('title', IFood)


  File ".. /zope/app/intid/__init__.py", line 161, in addIntIdSubscriber
  File ".. /zope/interface/interface.py", line 697, in __call__
  File ".. /zope/interface/interface.py", line 765, in __adapt__
  File ".. /zope/app/component/hooks.py", line 96, in adapter_hook
  File ".. /zope/interface/adapter.py", line 419, in adapter_hook
  File ".. /app/security/adapter.py", line 88, in __call__
  File ".. /zope/app/keyreference/persistent.py", line 41, in __init__
NotYet: <zope.app.catalog.text.TextIndex object at 0x4264c36c>
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to