web/action.py
branchtls-sprint
changeset 742 99115e029dca
parent 722 50a99184cf47
child 753 17d38f000bea
--- a/web/action.py	Wed Feb 18 00:48:24 2009 +0100
+++ b/web/action.py	Wed Feb 18 01:21:25 2009 +0100
@@ -7,6 +7,7 @@
 __docformat__ = "restructuredtext en"
 
 from cubicweb import role, target
+from cubicweb.vregistry import objectify_selector
 from cubicweb.selectors import (relation_possible, match_search_state,
                                 one_line_rset, may_add_relation, yes,
                                 accepts_compat, condition_compat, deprecate)
@@ -22,7 +23,7 @@
     """
     __registry__ = 'actions'
     __registerer__ = accepts_registerer
-    __selectors__ = (yes,) 
+    __select__ = yes()
     
     property_defs = {
         'visible':  dict(type='Boolean', default=True,
@@ -72,6 +73,7 @@
     using .etype, .rtype and .target attributes to check if the
     action apply and if the logged user has access to it
     """
+    @objectify_selector
     def my_selector(cls, req, rset, row=None, col=0, **kwargs):
         selector = (match_search_state('normal') & one_line_rset
                     & relation_possible(cls.rtype, role(cls), cls.etype,
@@ -79,7 +81,7 @@
                     & may_add_relation(cls.rtype, role(cls)))
         return selector(cls, req, rset, row, col, **kwargs)
 
-    __selectors__ = (my_selector,)
+    __select__ = my_selector()
     registered = accepts_compat(Action.registered.im_func)
     
     category = 'addrelated'