--- a/cubicweb/appobject.py Tue Jan 14 17:38:11 2020 +0100
+++ b/cubicweb/appobject.py Fri Jan 31 11:52:22 2020 +0100
@@ -29,12 +29,11 @@
"""
-from typing import Union
from logging import getLogger
from logilab.common.logging_ext import set_log_methods
-from logilab.common.registry import RegistrableObject, yes, Predicate
+from logilab.common.registry import RegistrableObject, yes
# the base class for all appobjects ############################################
@@ -75,7 +74,7 @@
such as `AnyEntity`, `EntityView`, `AnyRsetView`, `Action`...
"""
- __select__: Union[None, str, Predicate] = yes()
+ __select__ = yes()
@classmethod
def __registered__(cls, registry):
--- a/cubicweb/view.py Tue Jan 14 17:38:11 2020 +0100
+++ b/cubicweb/view.py Fri Jan 31 11:52:22 2020 +0100
@@ -22,12 +22,11 @@
import re
from io import BytesIO
-from typing import Union
from warnings import warn
from functools import partial
from inspect import getframeinfo, stack
-from logilab.common.registry import yes, Predicate
+from logilab.common.registry import yes
from logilab.mtconverter import xml_escape
from rql import nodes
@@ -359,7 +358,7 @@
class EntityView(View):
"""base class for views applying on an entity (i.e. uniform result set)"""
- __select__: Union[None, str, Predicate] = non_final_entity()
+ __select__ = non_final_entity()
category = _('entityview')
def call(self, **kwargs):
@@ -391,7 +390,7 @@
"""base class for views which doesn't need a particular result set to be
displayed (so they can always be displayed!)
"""
- __select__: Union[None, str, Predicate] = none_rset()
+ __select__ = none_rset()
category = _('startupview')
@@ -408,7 +407,7 @@
"""base class for entity views which may also be applied to None
result set (usually a default rql is provided by the view class)
"""
- __select__: Union[None, str, Predicate] = none_rset() | non_final_entity()
+ __select__ = none_rset() | non_final_entity()
default_rql = None
@@ -442,7 +441,7 @@
class AnyRsetView(View):
"""base class for views applying on any non empty result sets"""
- __select__: Union[None, str, Predicate] = nonempty_rset()
+ __select__ = nonempty_rset()
category = _('anyrsetview')
@@ -542,7 +541,7 @@
class Component(ReloadableMixIn, View):
"""base class for components"""
__registry__ = 'components'
- __select__: Union[None, str, Predicate] = yes()
+ __select__ = yes()
# XXX huummm, much probably useless (should be...)
htmlclass = 'mainRelated'