[Zope3-checkins] CVS: Zope3/src/zope/app/index/field - index.py:1.8

Anthony Baxter anthony@interlink.com.au
Sat, 12 Jul 2003 23:36:31 -0400


Update of /cvs-repository/Zope3/src/zope/app/index/field
In directory cvs.zope.org:/tmp/cvs-serv2618/app/index/field

Modified Files:
	index.py 
Log Message:
Say hello to Mr. Catalog. 

Merge of the melb-2003-content-catalog-branch.

Currently, only FieldIndexes are hooked up to catalogs. Will be 
hooking up TextIndex next. Catalogs can be added as both Utilities 
(see zope/app/catalog/catalog.txt for details on doing this) and in
Content space.


=== Zope3/src/zope/app/index/field/index.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/index/field/index.py:1.7	Mon Jun 23 12:44:38 2003
+++ Zope3/src/zope/app/index/field/index.py	Sat Jul 12 23:35:57 2003
@@ -34,11 +34,12 @@
      IObjectUnregisteredHubEvent, \
      IObjectModifiedHubEvent
 
-from zope.app.interfaces.index.field import IUIFieldIndex
+from zope.app.interfaces.index.field import IUIFieldIndex, IUIFieldCatalogIndex
+from zope.app.interfaces.catalog.index import ICatalogIndex
 
-class FieldIndex(FieldIndexWrapper):
+class FieldCatalogIndex(FieldIndexWrapper):
 
-    implements(ISubscriber, IUIFieldIndex)
+    implements(ISubscriber, ICatalogIndex, IUIFieldCatalogIndex)
 
     def __init__(self, field_name, interface=None):
         FieldIndexWrapper.__init__(self)
@@ -48,9 +49,7 @@
     field_name = property(lambda self: self._field_name)
     interface = property(lambda self: self._interface)
 
-
     def _getValue(self, object):
-
         if self._interface is not None:
             object = queryAdapter(object, self._interface)
             if object is None: return None
@@ -64,7 +63,6 @@
 
         return value
 
-
     def notify(self, event):
         """An event occurred.  Index or unindex the object in response."""
 
@@ -79,6 +77,10 @@
             except KeyError:
                 pass
     notify = ContextMethod(notify)
+
+class FieldIndex(FieldCatalogIndex):
+
+    implements(ISubscriber, IUIFieldIndex)
 
     currentlySubscribed = False # Default subscription state