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

Anthony Baxter anthony@interlink.com.au
Sat, 12 Jul 2003 03:09:58 -0400


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

Modified Files:
      Tag: melb-2003-content-catalog-branch
	index.py 
Log Message:
FieldIndexes installed in a catalog don't get a wacky little GUI
to manage their subscriptions, as they're always subscribed to their
catalog.

Broke the IUIFieldIndex into two to reflect this - the notify &c.
and the subscription management are separate interfaces.


=== Zope3/src/zope/app/index/field/index.py 1.7 => 1.7.6.1 ===
--- 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 03:09:23 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