selectors.py
branchtls-sprint
changeset 833 8c6bfd9158fb
parent 828 394927376a01
child 835 7dcb11dd443e
--- a/selectors.py	Wed Feb 18 20:32:16 2009 +0100
+++ b/selectors.py	Wed Feb 18 21:31:34 2009 +0100
@@ -708,6 +708,7 @@
             return any(x for x, in rset.description if x == self.target_etype)
         return bool(rset)
 
+
 class abstract_has_related_entities(AbstractSelectorMixIn, has_related_entities):
     def __init__(self, once_is_enough=False):
         super(abstract_has_related_entities, self).__init__(None, None,
@@ -1007,13 +1008,24 @@
     def plug_selector(cls, vreg):
         cls = registered(cls, vreg)
         if getattr(cls, 'accepts', None):
-            warn('use "match_user_groups(group1, group2)" instead of using require_groups',
+            warn('use "implements("EntityType", IFace)" instead of using accepts',
                  DeprecationWarning)
             cls.__select__ &= implements(*cls.accepts)
         return cls
     return plug_selector
 
 @unbind_method
+def accepts_etype_compat(registered):
+    def plug_selector(cls, vreg):
+        cls = registered(cls, vreg)
+        if getattr(cls, 'accepts', None):
+            warn('use "specified_etype_implements("EntityType", IFace)" instead of using accepts',
+                 DeprecationWarning)
+            cls.__select__ &= specified_etype_implements(*cls.accepts)
+        return cls
+    return plug_selector
+
+@unbind_method
 def condition_compat(registered):
     def plug_selector(cls, vreg):
         cls = registered(cls, vreg)