# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234874310 -3600 # Node ID ca3c4992c7d1811ded29d04618f69b17c15707c0 # Parent 36e87179e91d39e86e1f55ec97732b8146dc7ce5 kill [Singleton]VComponent diff -r 36e87179e91d -r ca3c4992c7d1 common/view.py --- a/common/view.py Tue Feb 17 13:26:24 2009 +0100 +++ b/common/view.py Tue Feb 17 13:38:30 2009 +0100 @@ -16,7 +16,7 @@ nonempty_rset, none_rset) from cubicweb.selectors import require_group_compat, accepts_compat from cubicweb.common.registerers import accepts_registerer, priority_registerer -from cubicweb.common.appobject import AppRsetObject, ComponentMixIn +from cubicweb.common.appobject import AppRsetObject from cubicweb.common.utils import UStringIO, HTMLStream _ = unicode @@ -466,15 +466,3 @@ self._stream.doctype = self.doctype if not xmldecl: self._stream.xmldecl = u'' - -# viewable components base classes ############################################ - -class VComponent(ComponentMixIn, View): - """base class for displayable components""" - property_defs = { - 'visible': dict(type='Boolean', default=True, - help=_('display the component or not')),} - -class SingletonVComponent(VComponent): - """base class for displayable unique components""" - __registerer__ = priority_registerer diff -r 36e87179e91d -r ca3c4992c7d1 sobjects/supervising.py --- a/sobjects/supervising.py Tue Feb 17 13:26:24 2009 +0100 +++ b/sobjects/supervising.py Tue Feb 17 13:38:30 2009 +0100 @@ -2,13 +2,14 @@ :organization: Logilab -:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ __docformat__ = "restructuredtext en" from cubicweb import UnknownEid -from cubicweb.common.view import ComponentMixIn, StartupView +from cubicweb.common.appobject import ComponentMixIn +from cubicweb.common.view import StartupView from cubicweb.common.mail import format_mail from cubicweb.server.hooksmanager import Hook from cubicweb.server.hookhelper import SendMailOp diff -r 36e87179e91d -r ca3c4992c7d1 web/component.py --- a/web/component.py Tue Feb 17 13:26:24 2009 +0100 +++ b/web/component.py Tue Feb 17 13:38:30 2009 +0100 @@ -6,20 +6,19 @@ """ __docformat__ = "restructuredtext en" -from cubicweb.selectors import (paginated_rset, one_line_rset, - primary_view, match_context_prop, - condition_compat, accepts_compat) -from cubicweb.common.appobject import Component, SingletonComponent +from cubicweb.selectors import ( + paginated_rset, one_line_rset, primary_view, match_context_prop, + condition_compat, accepts_compat, has_relation_compat) +from cubicweb.common.appobject import Component, SingletonComponent, ComponentMixIn from cubicweb.common.utils import merge_dicts -from cubicweb.common.view import VComponent, SingletonVComponent +from cubicweb.common.view import View from cubicweb.common.registerers import action_registerer -#rql_condition, accept, has_relation, etype_rtype_selector from cubicweb.common.uilib import html_escape _ = unicode -class EntityVComponent(VComponent): +class EntityVComponent(ComponentMixIn, View): """abstract base class for additinal components displayed in content headers and footer according to: @@ -32,13 +31,8 @@ __registry__ = 'contentnavigation' __registerer__ = action_registerer - __selectors__ = (one_line_rset, primary_view, - match_context_prop, -# etype_rtype_selector, -# has_relation, accept, -# rql_condition) - ) - registered = accepts_compat(condition_compat(VComponent.registered.im_func)) + __selectors__ = (one_line_rset, primary_view, match_context_prop,) + registered = accepts_compat(has_relation_compat(condition_compat(View.registered.im_func))) property_defs = { _('visible'): dict(type='Boolean', default=True, @@ -63,10 +57,11 @@ raise NotImplementedError() -class NavigationComponent(VComponent): +class NavigationComponent(ComponentMixIn, View): """abstract base class for navigation components""" + id = 'navigation' __selectors__ = (paginated_rset,) - id = 'navigation' + page_size_property = 'navigation.page-size' start_param = '__start' stop_param = '__stop' @@ -152,16 +147,10 @@ class RelatedObjectsVComponent(EntityVComponent): """a section to display some related entities""" - __selectors__ = (one_line_rset, primary_view, - match_context_prop, -# etype_rtype_selector, has_relation, -# accept) - ) vid = 'list' def rql(self): - """override this method if you want to use a custom rql query. - """ + """override this method if you want to use a custom rql query""" return None def cell_call(self, row, col, view=None):