[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/browser/stateful - content_filter.py:1.2 filteradapter.py:1.2

Jim Fulton jim at zope.com
Sat Mar 6 12:49:25 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/workflow/browser/stateful
In directory cvs.zope.org:/tmp/cvs-serv21993/src/zope/app/workflow/browser/stateful

Modified Files:
	content_filter.py filteradapter.py 
Log Message:
Changed most calls to queryAdapter to use interface calls instead.


=== Zope3/src/zope/app/workflow/browser/stateful/content_filter.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/stateful/content_filter.py:1.1	Fri Feb 27 11:50:38 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/content_filter.py	Sat Mar  6 12:48:55 2004
@@ -15,7 +15,6 @@
  
 $Id$
 """
-from zope.component import queryAdapter
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
 from zope.app.browser.container.contents import Contents
 from zope.app.workflow.interfaces import IProcessInstanceContainerAdaptable
@@ -32,14 +31,18 @@
         """Filter a list of objects according to given workflow and state
 
         objList  ... list of objects
-        state    ... name of a state (of the given workflow) in which the result
-                      objects must be
-        workflow ... name of a workflow to which result objects must be attached
+        
+        state    ... name of a state (of the given workflow) in which the
+                     result objects must be
+
+        workflow ... name of a workflow to which result objects must
+                     be attached
+        
         """
         res = []
 
         for obj in objList:
-            adapter = queryAdapter(obj['object'], IProcessInstanceContainer)
+            adapter = IProcessInstanceContainer(obj['object'], None)
             if adapter:
                 for item in adapter.values():
                     if item.processDefinitionName != workflow:


=== Zope3/src/zope/app/workflow/browser/stateful/filteradapter.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/workflow/browser/stateful/filteradapter.py:1.1	Fri Feb 27 11:50:38 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/filteradapter.py	Sat Mar  6 12:48:55 2004
@@ -16,7 +16,6 @@
 $Id$
 """
 from zope.interface import implements
-from zope.component import queryAdapter 
 from zope.app.workflow.interfaces import IProcessInstanceContainerAdaptable
 from zope.app.workflow.interfaces import IProcessInstanceContainer
 
@@ -45,7 +44,7 @@
 
     def filterObjectByState(self, object, state, workflow='default'):
         """See IContentFilterAdapter"""
-        adapter = queryAdapter(object, IProcessInstanceContainer)
+        adapter = IProcessInstanceContainer(object, None)
         if not adapter:
             return False
             




More information about the Zope3-Checkins mailing list