[schema views] don't propose 'view all' action for final entity types (closes #1560549) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Mar 2011 18:20:34 +0100
branchstable
changeset 7100 0f02ad198c1b
parent 7099 ee9f1e1890e0
child 7101 de388d0b727e
[schema views] don't propose 'view all' action for final entity types (closes #1560549)
web/views/actions.py
--- a/web/views/actions.py	Wed Mar 23 11:35:41 2011 +0100
+++ b/web/views/actions.py	Wed Mar 23 18:20:34 2011 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -28,7 +28,7 @@
 from cubicweb.appobject import objectify_selector
 from cubicweb.selectors import (EntitySelector, yes,
     one_line_rset, multi_lines_rset, one_etype_rset, relation_possible,
-    nonempty_rset, non_final_entity,
+    nonempty_rset, non_final_entity, score_entity,
     authenticated_user, match_user_groups, match_search_state,
     has_permission, has_add_permission, is_instance, debug_mode,
     )
@@ -322,7 +322,7 @@
     """when displaying the schema of a CWEType, offer to list entities of that type
     """
     __regid__ = 'entitiesoftype'
-    __select__ = one_line_rset() & is_instance('CWEType')
+    __select__ = one_line_rset() & is_instance('CWEType') & score_entity(lambda x: not x.final)
     category = 'mainactions'
     order = 40