selectors.py
branchtls-sprint
changeset 1263 01152fffd593
parent 1178 8d9b705168d3
child 1301 4596ce9bb4dc
--- a/selectors.py	Mon Apr 06 12:37:45 2009 +0200
+++ b/selectors.py	Tue Apr 07 09:30:23 2009 +0200
@@ -476,6 +476,17 @@
         return score
 
 
+class match_view(match_search_state):
+    """accept if the current view is in one of the expected vid given to the
+    initializer
+    """
+    @lltrace
+    def __call__(self, cls, req, rset, row=None, col=0, view=None, **kwargs):
+        if view is None or not view.id in self.expected:
+            return 0
+        return 1
+
+
 class appobject_selectable(Selector):
     """accept with another appobject is selectable using selector's input
     context.