# HG changeset patch # User Sandrine Ribeau <sandrine.ribeau@logilab.fr> # Date 1254859138 25200 # Tue Oct 06 12:58:58 2009 -0700 # Node ID 7e2c2fbbe84157815baae7521e110c1636144645 # Parent ea019423d4ea5b8732ae51befe058c3337311850 [views] use score_entity instead of rql_condition diff --git a/views.py b/views.py --- a/views.py +++ b/views.py @@ -16,7 +16,7 @@ from cubicweb.selectors import (one_line_rset, but_etype, implements, has_permission, relation_possible, yes, - match_kwargs, rql_condition) + match_kwargs, score_entity) from cubicweb.view import EntityView from cubicweb.common.uilib import rql_for_eid, cut, safe_cut from cubicweb.common.mixins import TreeViewMixIn @@ -318,8 +318,8 @@ class DelteCommentAction(Action): id = 'delete_comment' - __select__ = implements('Comment') & has_permission('delete') \ - & rql_condition('NOT EXISTS(C comments X)') + __select__ = implements('Comment') & \ + score_entity(lambda x: not x.reverse_comments and x.has_perm('delete')) title = _('delete comment') category = 'hidden'