# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234916751 -3600 # Node ID af9c15653ea9aaa1db77f1b22b60c91685305eac # Parent 3e46854acf58c04edbf8c5945ca823a9c8e407e5# Parent 99115e029dcaf59646459e2e3e4c2bdabbbfdfb0 merge diff -r 3e46854acf58 -r af9c15653ea9 goa/appobjects/dbmgmt.py --- a/goa/appobjects/dbmgmt.py Wed Feb 18 01:24:12 2009 +0100 +++ b/goa/appobjects/dbmgmt.py Wed Feb 18 01:25:51 2009 +0100 @@ -40,7 +40,7 @@ which are doing datastore administration requests """ id = 'authinfo' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') def call(self): cookie = self.req.get_cookie() @@ -62,7 +62,7 @@ step by step to avoid depassing quotas """ id = 'contentinit' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') def server_session(self): ssession = self.config.repo_session(self.req.cnx.sessionid) @@ -167,7 +167,7 @@ class ContentClear(StartupView): id = 'contentclear' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') skip_etypes = ('EGroup', 'EUser') def call(self): diff -r 3e46854acf58 -r af9c15653ea9 goa/appobjects/sessions.py --- a/goa/appobjects/sessions.py Wed Feb 18 01:24:12 2009 +0100 +++ b/goa/appobjects/sessions.py Wed Feb 18 01:25:51 2009 +0100 @@ -255,7 +255,7 @@ class SessionsCleaner(StartupView): id = 'cleansessions' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') def call(self): # clean web session diff -r 3e46854acf58 -r af9c15653ea9 test/unittest_vregistry.py --- a/test/unittest_vregistry.py Wed Feb 18 01:24:12 2009 +0100 +++ b/test/unittest_vregistry.py Wed Feb 18 01:25:51 2009 +0100 @@ -40,6 +40,7 @@ __selectors__ = (myselector1, myselector2) AnAppObject.build___select__() self.assertEquals(AnAppObject.__select__(AnAppObject), 2) + self.assertEquals(AnAppObject.__select__(), 2) def test_properties(self): self.failIf('system.version.cubicweb' in self.vreg['propertydefs']) diff -r 3e46854acf58 -r af9c15653ea9 web/action.py --- a/web/action.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/action.py Wed Feb 18 01:25:51 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' diff -r 3e46854acf58 -r af9c15653ea9 web/box.py --- a/web/box.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/box.py Wed Feb 18 01:25:51 2009 +0100 @@ -10,6 +10,7 @@ from logilab.mtconverter import html_escape from cubicweb import Unauthorized, role as get_role +from cubicweb.vregistry import objectify_selector from cubicweb.selectors import (one_line_rset, primary_view, match_context_prop, has_related_entities, accepts_compat, condition_compat) @@ -39,7 +40,7 @@ box.render(self.w) """ __registry__ = 'boxes' - __selectors__ = Template.__selectors__ + (match_context_prop,) + __select__ = Template.__select__ & match_context_prop() categories_in_order = () property_defs = { @@ -139,9 +140,7 @@ class EntityBoxTemplate(BoxTemplate): """base class for boxes related to a single entity""" __registerer__ = accepts_registerer - __selectors__ = (one_line_rset, primary_view, - match_context_prop,) - #etype_rtype_selector, has_relation) + __select__ = one_line_rset() & primary_view() & match_context_prop() registered = accepts_compat(condition_compat(BoxTemplate.registered)) context = 'incontext' @@ -151,8 +150,13 @@ class RelatedEntityBoxTemplate(EntityBoxTemplate): - __selectors__ = EntityBoxTemplate.__selectors__ + (has_related_entities,) - + # XXX find a way to generalize access to cls.rtype + @objectify_selector + def my_selector(cls, req, rset, row=None, col=0, **kwargs): + return EntityBoxTemplate.__select__ & has_related_entities(cls.rtype) + + __select__ = my_selector + def cell_call(self, row, col, **kwargs): entity = self.entity(row, col) limit = self.req.property_value('navigation.related-limit') + 1 diff -r 3e46854acf58 -r af9c15653ea9 web/component.py --- a/web/component.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/component.py Wed Feb 18 01:25:51 2009 +0100 @@ -31,7 +31,7 @@ __registry__ = 'contentnavigation' __registerer__ = accepts_registerer - __selectors__ = (one_line_rset, primary_view, match_context_prop,) + __select__ = one_line_rset() & primary_view() & match_context_prop() registered = accepts_compat(has_relation_compat(condition_compat(View.registered))) property_defs = { @@ -60,7 +60,7 @@ class NavigationComponent(Component): """abstract base class for navigation components""" id = 'navigation' - __selectors__ = (paginated_rset,) + __select__ = paginated_rset() page_size_property = 'navigation.page-size' start_param = '__start' diff -r 3e46854acf58 -r af9c15653ea9 web/controller.py --- a/web/controller.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/controller.py Wed Feb 18 01:25:51 2009 +0100 @@ -68,7 +68,7 @@ """ __registry__ = 'controllers' __registerer__ = priority_registerer - __selectors__ = (yes,) + __select__ = yes() registered = require_group_compat(AppObject.registered.im_func) def __init__(self, *args, **kwargs): diff -r 3e46854acf58 -r af9c15653ea9 web/facet.py --- a/web/facet.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/facet.py Wed Feb 18 01:25:51 2009 +0100 @@ -19,6 +19,7 @@ from rql import parse, nodes from cubicweb import Unauthorized, typed_eid +from cubicweb.vregistry import objectify_selector from cubicweb.selectors import match_context_prop, one_has_relation from cubicweb.appobject import AppRsetObject from cubicweb.common.registerers import priority_registerer @@ -333,10 +334,17 @@ class RelationFacet(VocabularyFacet): - __selectors__ = (one_has_relation, match_context_prop) - # class attributes to configure the relation facet + # XXX find a way to generalize access to cls.rtype + @objectify_selector + def my_selector(cls, req, rset, row=None, col=0, **kwargs): + selector = (relation_possible(cls.rtype, role(cls)) + & match_context_prop()) + return selector(cls, req, rset, row, col, **kwargs) + + __select__ = my_selector() + # class attributes to configure the rel ation facet rtype = None - role = 'subject' + role = 'subject' target_attr = 'eid' # set this to a stored procedure name if you want to sort on the result of # this function's result instead of direct value diff -r 3e46854acf58 -r af9c15653ea9 web/views/ajaxedit.py --- a/web/views/ajaxedit.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/ajaxedit.py Wed Feb 18 01:25:51 2009 +0100 @@ -17,7 +17,8 @@ class attributes. """ __registry__ = 'views' - __selectors__ = (chainfirst(match_form_params, match_kwargs),) + __select__ = (match_form_params('rtype', 'target') + | match_kwargs('rtype', 'target')) property_defs = {} # don't want to inherit this from Box id = 'xaddrelation' expected_kwargs = form_params = ('rtype', 'target') diff -r 3e46854acf58 -r af9c15653ea9 web/views/basecomponents.py --- a/web/views/basecomponents.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/basecomponents.py Wed Feb 18 01:25:51 2009 +0100 @@ -118,7 +118,7 @@ """display application's messages given using the __message parameter into a special div section """ - __selectors__ = yes, + __select__ = yes() id = 'applmessages' site_wide = True # don't want user to hide this component using an eproperty @@ -136,8 +136,8 @@ class WFHistoryVComponent(EntityVComponent): """display the workflow history for entities supporting it""" id = 'wfhistory' - __selectors__ = EntityVComponent.__selectors__ + ( - relation_possible('wf_info_for', role='object'),) + __select__ = (EntityVComponent.__select__ + & relation_possible('wf_info_for', role='object')) context = 'navcontentbottom' title = _('Workflow history') @@ -241,14 +241,14 @@ class RSSFeedURL(Component): id = 'rss_feed_url' - __selectors__ = (non_final_entity(),) + __select__ = non_final_entity() def feed_url(self): return self.build_url(rql=self.limited_rql(), vid='rss') class RSSEntityFeedURL(Component): id = 'rss_feed_url' - __selectors__ = (non_final_entity(), one_line_rset) + __select__ = non_final_entity() & one_line_rset() def feed_url(self): return self.entity(0, 0).rss_feed_url() diff -r 3e46854acf58 -r af9c15653ea9 web/views/basecontrollers.py --- a/web/views/basecontrollers.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/basecontrollers.py Wed Feb 18 01:25:51 2009 +0100 @@ -465,7 +465,7 @@ class SendMailController(Controller): id = 'sendmail' - __selectors__ = (match_user_groups('managers', 'users'),) + __select__ = match_user_groups('managers', 'users') def recipients(self): """returns an iterator on email's recipients as entities""" @@ -513,7 +513,7 @@ class MailBugReportController(SendMailController): id = 'reportbug' - __selectors__ = (yes,) + __select__ = yes() def publish(self, rset=None): body = self.req.form['description'] diff -r 3e46854acf58 -r af9c15653ea9 web/views/baseforms.py --- a/web/views/baseforms.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/baseforms.py Wed Feb 18 01:25:51 2009 +0100 @@ -90,7 +90,7 @@ id = 'statuschange' title = _('status change') - __selectors__ = (implements(IWorkflowable), match_form_params('treid')) + __select__ = implements(IWorkflowable) & match_form_params('treid') def cell_call(self, row, col, vid='secondary'): entity = self.entity(row, col) @@ -151,7 +151,7 @@ class ClickAndEditForm(EntityForm): id = 'reledit' - __selectors__ = (match_kwargs('rtype'), ) + __select__ = match_kwargs('rtype') #FIXME editableField class could be toggleable from userprefs @@ -216,7 +216,7 @@ dynamic default values such as the 'tomorrow' date or the user's login being connected """ - __selectors__ = (one_line_rset, implements('Any')) + __select__ = one_line_rset() & implements('Any') id = 'edition' title = _('edition') @@ -523,7 +523,7 @@ class CreationForm(EditionForm): - __selectors__ = (specified_etype_implements('Any'), ) + __select__ = specified_etype_implements('Any') id = 'creation' title = _('creation') @@ -636,7 +636,8 @@ class InlineEntityCreationForm(InlineFormMixIn, CreationForm): id = 'inline-creation' - __selectors__ = (match_kwargs('ptype', 'peid', 'rtype'), specified_etype_implements('Any')) + __select__ = (match_kwargs('ptype', 'peid', 'rtype') + & specified_etype_implements('Any')) EDITION_BODY = u'''\ @@ -675,7 +676,8 @@ class InlineEntityEditionForm(InlineFormMixIn, EditionForm): id = 'inline-edition' - __selectors__ = (implements('Any'), match_kwargs('ptype', 'peid', 'rtype')) + __select__ = (implements('Any') + & match_kwargs('ptype', 'peid', 'rtype')) EDITION_BODY = u'''\
@@ -877,7 +879,7 @@ class UnrelatedDivs(EntityView): id = 'unrelateddivs' - __selectors__ = (match_form_params('relation',),) + __select__ = match_form_params('relation') @property def limit(self): diff -r 3e46854acf58 -r af9c15653ea9 web/views/baseviews.py --- a/web/views/baseviews.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/baseviews.py Wed Feb 18 01:25:51 2009 +0100 @@ -43,7 +43,7 @@ class NoResultView(View): """default view when no result has been found""" - __selectors__ = (empty_rset,) + __select__ = empty_rset() id = 'noresult' def call(self, **kwargs): @@ -790,8 +790,8 @@ to search for something to link to the edited eid """ id = 'search-associate' - __selectors__ = (one_line_rset, match_search_state('linksearch'), - non_final_entity()) + __select__ = (one_line_rset() & match_search_state('linksearch') + & non_final_entity()) title = _('search for association') @@ -848,8 +848,7 @@ """ id = 'editrelation' - __selectors__ = (match_form_params,) - form_params = ('rtype',) + __select__ = match_form_params('rtype') # TODO: inlineview, multiple edit, (widget view ?) def cell_call(self, row, col, rtype=None, role='subject', targettype=None, diff -r 3e46854acf58 -r af9c15653ea9 web/views/bookmark.py --- a/web/views/bookmark.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/bookmark.py Wed Feb 18 01:25:51 2009 +0100 @@ -18,7 +18,7 @@ class FollowAction(Action): id = 'follow' - __selectors__ = (implements('Bookmark'),) + __select__ = implements('Bookmark') title = _('follow') category = 'mainactions' @@ -28,7 +28,7 @@ class BookmarkPrimaryView(PrimaryView): - __selectors__ = (implements('Bookmark'),) + __select__ = implements('Bookmark') def cell_call(self, row, col): """the primary view for bookmark entity""" diff -r 3e46854acf58 -r af9c15653ea9 web/views/boxes.py --- a/web/views/boxes.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/boxes.py Wed Feb 18 01:25:51 2009 +0100 @@ -29,7 +29,7 @@ box with all actions impacting the entity displayed: edit, copy, delete change state, add related entities """ - __selectors__ = (any_rset,) + BoxTemplate.__selectors__ + __select__ = any_rset() & BoxTemplate.__select__ id = 'edit_box' title = _('actions') order = 2 @@ -166,7 +166,7 @@ class PossibleViewsBox(BoxTemplate): """display a box containing links to all possible views""" id = 'possible_views_box' - __selectors__ = (match_user_groups('users', 'managers'),) + __select__ = match_user_groups('users', 'managers') title = _('possible views') order = 10 @@ -188,7 +188,8 @@ class RSSIconBox(BoxTemplate): """just display the RSS icon on uniform result set""" id = 'rss' - __selectors__ = BoxTemplate.__selectors__ + (appobject_selectable('components', 'rss_feed_url'),) + __select__ = (BoxTemplate.__select__ + & appobject_selectable('components', 'rss_feed_url')) order = 999 visible = False diff -r 3e46854acf58 -r af9c15653ea9 web/views/debug.py --- a/web/views/debug.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/debug.py Wed Feb 18 01:25:51 2009 +0100 @@ -26,7 +26,7 @@ class DebugView(StartupView): id = 'debug' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') title = _('server debug information') def call(self, **kwargs): diff -r 3e46854acf58 -r af9c15653ea9 web/views/embedding.py --- a/web/views/embedding.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/embedding.py Wed Feb 18 01:25:51 2009 +0100 @@ -91,9 +91,9 @@ if the returned url match embeding configuration """ id = 'embed' - __selectors__ = (one_line_rset, match_search_state('normal'), - implements(IEmbedable), - score_entity(entity_has_embedable_url)) + __select__ = (one_line_rset() & match_search_state('normal') + & implements(IEmbedable) + & score_entity(entity_has_embedable_url)) title = _('embed') controller = 'embed' diff -r 3e46854acf58 -r af9c15653ea9 web/views/facets.py --- a/web/views/facets.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/facets.py Wed Feb 18 01:25:51 2009 +0100 @@ -10,13 +10,15 @@ from logilab.mtconverter import html_escape +from cubicweb.vregistry import objectify_selector from cubicweb.selectors import (chainfirst, chainall, non_final_entity, two_lines_rset, match_context_prop, - yes, one_has_relation) + yes, relation_possible) from cubicweb.web.box import BoxTemplate from cubicweb.web.facet import (AbstractFacet, VocabularyFacet, FacetStringWidget, RelationFacet, prepare_facets_rqlst, filter_hiddens) +@objectify_selector def contextview_selector(cls, req, rset, row=None, col=None, view=None, **kwargs): if view and getattr(view, 'filter_box_context_info', lambda: None)(): @@ -27,8 +29,9 @@ class FilterBox(BoxTemplate): """filter results of a query""" id = 'filter_box' - __selectors__ = ((non_final_entity() & two_lines_rset) | contextview_selector, - match_context_prop) + __select__ = (((non_final_entity() & two_lines_rset()) + | contextview_selector + ) & match_context_prop) context = 'left' title = _('boxes_filter_box') visible = True # functionality provided by the search box by default @@ -128,7 +131,7 @@ # inherit from RelationFacet to benefit from its possible_values implementation class ETypeFacet(RelationFacet): id = 'etype-facet' - __selectors__ = (yes,) + __select__ = yes() order = 1 rtype = 'is' target_attr = 'name' @@ -152,7 +155,7 @@ class HasTextFacet(AbstractFacet): - __selectors__ = (one_has_relation, match_context_prop) + __select__ = relation_possible('has_text', 'subject') & match_context_prop() id = 'has_text-facet' rtype = 'has_text' role = 'subject' diff -r 3e46854acf58 -r af9c15653ea9 web/views/ibreadcrumbs.py --- a/web/views/ibreadcrumbs.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/ibreadcrumbs.py Wed Feb 18 01:25:51 2009 +0100 @@ -28,7 +28,7 @@ # register msg not generated since no entity implements IPrevNext in cubicweb itself title = _('contentnavigation_breadcrumbs') help = _('contentnavigation_breadcrumbs_description') - __selectors__ = (one_line_rset, match_context_prop, implements(IBreadCrumbs)) + __select__ = (one_line_rset() & match_context_prop() & implements(IBreadCrumbs)) context = 'navtop' order = 5 visible = False diff -r 3e46854acf58 -r af9c15653ea9 web/views/idownloadable.py --- a/web/views/idownloadable.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/idownloadable.py Wed Feb 18 01:25:51 2009 +0100 @@ -35,7 +35,7 @@ class DownloadBox(EntityBoxTemplate): id = 'download_box' - __selectors__ = (one_line_rset, implements(IDownloadable), match_context_prop) + __select__ = (one_line_rset() & implements(IDownloadable) & match_context_prop()) order = 10 def cell_call(self, row, col, title=None, label=None, **kwargs): entity = self.entity(row, col) @@ -47,7 +47,7 @@ downloading of entities providing the necessary interface """ id = 'download' - __selectors__ = (one_line_rset, implements(IDownloadable)) + __select__ = one_line_rset() & implements(IDownloadable) templatable = False content_type = 'application/octet-stream' @@ -74,7 +74,7 @@ class DownloadLinkView(baseviews.EntityView): """view displaying a link to download the file""" id = 'downloadlink' - __selectors__ = (implements(IDownloadable),) + __select__ = implements(IDownloadable) title = None # should not be listed in possible views @@ -86,7 +86,7 @@ class IDownloadablePrimaryView(baseviews.PrimaryView): - __selectors__ = (implements(IDownloadable),) + __select__ = implements(IDownloadable) #skip_attrs = ('eid', 'data',) # XXX def render_entity_title(self, entity): @@ -118,7 +118,7 @@ class IDownloadableLineView(baseviews.OneLineView): - __selectors__ = (implements(IDownloadable),) + __select__ = implements(IDownloadable) def cell_call(self, row, col, title=None, **kwargs): """the secondary view is a link to download the file""" @@ -138,8 +138,7 @@ class ImageView(baseviews.EntityView): id = 'image' - __selectors__ = (implements(IDownloadable), - score_entity(is_image)) + __select__ = implements(IDownloadable) & score_entity(is_image) title = _('image') diff -r 3e46854acf58 -r af9c15653ea9 web/views/management.py --- a/web/views/management.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/management.py Wed Feb 18 01:25:51 2009 +0100 @@ -270,7 +270,7 @@ class ProcessInformationView(StartupView): id = 'info' - __selectors__ = (none_rset, match_user_groups('managers'),) + __select__ = none_rset() & match_user_groups('managers') title = _('server information') diff -r 3e46854acf58 -r af9c15653ea9 web/views/massmailing.py --- a/web/views/massmailing.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/massmailing.py Wed Feb 18 01:25:51 2009 +0100 @@ -19,7 +19,7 @@ class SendEmailAction(Action): category = 'mainactions' # XXX should check email is set as well - __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users')) + __select__ = implements(IEmailable) & match_user_groups('managers', 'users') id = 'sendemail' title = _('send email') @@ -34,7 +34,7 @@ class MassMailingForm(EntityView): id = 'massmailing' - __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users')) + __select__ = implements(IEmailable) & match_user_groups('managers', 'users') form_template = u"""
diff -r 3e46854acf58 -r af9c15653ea9 web/views/navigation.py --- a/web/views/navigation.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/navigation.py Wed Feb 18 01:25:51 2009 +0100 @@ -51,7 +51,7 @@ """sorted navigation apply if navigation is needed (according to page size) and if the result set is sorted """ - __selectors__ = (paginated_rset, sorted_rset) + __select__ = paginated_rset() & sorted_rset() # number of considered chars to build page links nb_chars = 5 @@ -180,8 +180,8 @@ # itself title = _('contentnavigation_prevnext') help = _('contentnavigation_prevnext_description') - __selectors__ = (one_line_rset, primary_view, - match_context_prop, implements(IPrevNext)) + __select__ = (one_line_rset() & primary_view() + & match_context_prop() & implements(IPrevNext)) context = 'navbottom' order = 10 def call(self, view=None): diff -r 3e46854acf58 -r af9c15653ea9 web/views/plots.py --- a/web/views/plots.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/plots.py Wed Feb 18 01:25:51 2009 +0100 @@ -2,8 +2,10 @@ from logilab.common import flatten +from cubicweb.vregistry import objectify_selector from cubicweb.web.views import baseviews +@objectify_selector def plot_selector(cls, req, rset, *args, **kwargs): """accept result set with at least one line and two columns of result all columns after second must be of numerical types""" @@ -34,7 +36,7 @@ binary = True content_type = 'image/png' _plot_count = 0 - __selectors__ = (plot_selector,) + __select__ = plot_selector() def call(self, width=None, height=None): # compute dimensions diff -r 3e46854acf58 -r af9c15653ea9 web/views/tableview.py --- a/web/views/tableview.py Wed Feb 18 01:24:12 2009 +0100 +++ b/web/views/tableview.py Wed Feb 18 01:25:51 2009 +0100 @@ -5,8 +5,6 @@ :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ -from __future__ import with_statement - __docformat__ = "restructuredtext en" from simplejson import dumps @@ -223,9 +221,7 @@ def render(self, cellvid, row, col, w): - from cubicweb.selectors import traced_selection - with traced_selection( ('cell',) ): - self.view('cell', self.rset, row=row, col=col, cellvid=cellvid, w=w) + self.view('cell', self.rset, row=row, col=col, cellvid=cellvid, w=w) def get_rows(self): return self.rset @@ -256,8 +252,7 @@ class CellView(EntityView): - __selectors__ = (nonempty_rset, accept_rset) - # XXX backport implements('Any') ?? + __select__ = nonempty_rset() id = 'cell' @@ -292,8 +287,7 @@ displayed with default restrictions set """ id = 'initialtable' - __selectors__ = nonempty_rset, match_form_params - form_params = ('actualrql',) + __select__ = nonempty_rset() & match_form_params('actualrql') # should not be displayed in possible view since it expects some specific # parameters title = None