web/action.py
branchtls-sprint
changeset 753 17d38f000bea
parent 742 99115e029dca
child 757 01740274e774
equal deleted inserted replaced
752:c0506c4a1e6c 753:17d38f000bea
    73     using .etype, .rtype and .target attributes to check if the
    73     using .etype, .rtype and .target attributes to check if the
    74     action apply and if the logged user has access to it
    74     action apply and if the logged user has access to it
    75     """
    75     """
    76     @objectify_selector
    76     @objectify_selector
    77     def my_selector(cls, req, rset, row=None, col=0, **kwargs):
    77     def my_selector(cls, req, rset, row=None, col=0, **kwargs):
    78         selector = (match_search_state('normal') & one_line_rset
    78         selector = (match_search_state('normal') & one_line_rset()
    79                     & relation_possible(cls.rtype, role(cls), cls.etype,
    79                     & relation_possible(cls.rtype, role(cls), cls.etype,
    80                                         action='add')
    80                                         action='add')
    81                     & may_add_relation(cls.rtype, role(cls)))
    81                     & may_add_relation(cls.rtype, role(cls)))
    82         return selector(cls, req, rset, row, col, **kwargs)
    82         return selector(cls, req, rset, row, col, **kwargs)
    83 
    83