__select__ migration tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 17 Feb 2009 23:42:56 +0100
branchtls-sprint
changeset 723 1f551018fdfb
parent 722 50a99184cf47
child 724 1ecba333cfb0
__select__ migration
selectors.py
--- a/selectors.py	Tue Feb 17 23:40:30 2009 +0100
+++ b/selectors.py	Tue Feb 17 23:42:56 2009 +0100
@@ -949,7 +949,7 @@
         if getattr(cls, 'require_groups', None):
             warn('use "match_user_groups(group1, group2)" instead of using require_groups',
                  DeprecationWarning)
-            cls.__selectors__ += (match_user_groups(cls.require_groups),)
+            cls.__select__ &= (match_user_groups(cls.require_groups),)
         return cls
     return plug_selector
 
@@ -960,7 +960,7 @@
         if getattr(cls, 'accepts', None):
             warn('use "match_user_groups(group1, group2)" instead of using require_groups',
                  DeprecationWarning)
-            cls.__selectors__ += (implements(*cls.accepts),)
+            cls.__select__ &= (implements(*cls.accepts),)
         return cls
     return plug_selector
 
@@ -971,7 +971,7 @@
         if getattr(cls, 'condition', None):
             warn('use "use rql_condition(expression)" instead of using condition',
                  DeprecationWarning)
-            cls.__selectors__ += (rql_condition(cls.condition),)
+            cls.__select__ &= (rql_condition(cls.condition),)
         return cls
     return plug_selector
      
@@ -982,8 +982,8 @@
         if getattr(cls, 'type', None):
             warn('use relation_possible selector instead of using etype_rtype',
                  DeprecationWarning)
-            cls.__selectors__ += (relation_possible(cls.rtype, role(cls),
-                                                    getattr(cls, 'etype', None),
-                                                    action=getattr(cls, 'require_permission', 'read')))
+            cls.__select__ &= (relation_possible(cls.rtype, role(cls),
+                                                 getattr(cls, 'etype', None),
+                                                 action=getattr(cls, 'require_permission', 'read')))
         return cls
     return plug_selector