cubicweb/appobject.py
changeset 12831 b1ef9690f357
parent 12508 a8c1ea390400
child 12846 ba3cf6aaa695
equal deleted inserted replaced
12830:5318da3497e8 12831:b1ef9690f357
    27 common to all the application objects.
    27 common to all the application objects.
    28 
    28 
    29 """
    29 """
    30 
    30 
    31 
    31 
       
    32 from typing import Union
    32 from logging import getLogger
    33 from logging import getLogger
    33 
    34 
    34 from logilab.common.logging_ext import set_log_methods
    35 from logilab.common.logging_ext import set_log_methods
    35 
    36 
    36 from logilab.common.registry import RegistrableObject, yes
    37 from logilab.common.registry import RegistrableObject, yes, Predicate
    37 
    38 
    38 
    39 
    39 # the base class for all appobjects ############################################
    40 # the base class for all appobjects ############################################
    40 
    41 
    41 class AppObject(RegistrableObject):
    42 class AppObject(RegistrableObject):
    72 
    73 
    73       * do not inherit directly from this class but from a more specific class
    74       * do not inherit directly from this class but from a more specific class
    74         such as `AnyEntity`, `EntityView`, `AnyRsetView`, `Action`...
    75         such as `AnyEntity`, `EntityView`, `AnyRsetView`, `Action`...
    75 
    76 
    76     """
    77     """
    77     __select__ = yes()
    78     __select__: Union[None, str, Predicate] = yes()
    78 
    79 
    79     @classmethod
    80     @classmethod
    80     def __registered__(cls, registry):
    81     def __registered__(cls, registry):
    81         """called by the registry when the appobject has been registered.
    82         """called by the registry when the appobject has been registered.
    82 
    83