web/action.py
branchtls-sprint
changeset 838 f2c56312b03a
parent 782 01801a10c567
child 1432 2c3711d4570b
equal deleted inserted replaced
836:2ca048a43240 838:f2c56312b03a
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 """
     6 """
     7 __docformat__ = "restructuredtext en"
     7 __docformat__ = "restructuredtext en"
     8 
     8 
     9 from cubicweb import target
     9 from cubicweb import target
    10 from cubicweb.selectors import (abstract_relation_possible, match_search_state,
    10 from cubicweb.selectors import (partial_relation_possible, match_search_state,
    11                                 one_line_rset, abstract_may_add_relation, yes,
    11                                 one_line_rset, partial_may_add_relation, yes,
    12                                 accepts_compat, condition_compat, deprecate)
    12                                 accepts_compat, condition_compat, deprecate)
    13 from cubicweb.appobject import AppRsetObject
    13 from cubicweb.appobject import AppRsetObject
    14 from cubicweb.common.registerers import accepts_registerer
    14 from cubicweb.common.registerers import accepts_registerer
    15 
    15 
    16 _ = unicode
    16 _ = unicode
    71     Additionaly to EntityAction behaviour, this class is parametrized
    71     Additionaly to EntityAction behaviour, this class is parametrized
    72     using .etype, .rtype and .target attributes to check if the
    72     using .etype, .rtype and .target attributes to check if the
    73     action apply and if the logged user has access to it
    73     action apply and if the logged user has access to it
    74     """
    74     """
    75     __select__ = (match_search_state('normal') & one_line_rset()
    75     __select__ = (match_search_state('normal') & one_line_rset()
    76                   & abstract_relation_possible(action='add')
    76                   & partial_relation_possible(action='add')
    77                   & abstract_may_add_relation())
    77                   & partial_may_add_relation())
    78     registered = accepts_compat(Action.registered)
    78     registered = accepts_compat(Action.registered)
    79     
    79     
    80     category = 'addrelated'
    80     category = 'addrelated'
    81                 
    81                 
    82     def url(self):
    82     def url(self):