web/component.py
branchtls-sprint
changeset 1432 2c3711d4570b
parent 1339 f74674c042ed
child 1433 091ac3ba5d51
equal deleted inserted replaced
1426:379261551578 1432:2c3711d4570b
    14 from cubicweb.view import View, Component
    14 from cubicweb.view import View, Component
    15 from cubicweb.selectors import (
    15 from cubicweb.selectors import (
    16     paginated_rset, one_line_rset, primary_view, match_context_prop,
    16     paginated_rset, one_line_rset, primary_view, match_context_prop,
    17     partial_has_related_entities, condition_compat, accepts_compat,
    17     partial_has_related_entities, condition_compat, accepts_compat,
    18     has_relation_compat)
    18     has_relation_compat)
    19 from cubicweb.common.registerers import accepts_registerer
       
    20 
    19 
    21 _ = unicode
    20 _ = unicode
    22 
    21 
    23 class EntityVComponent(Component):
    22 class EntityVComponent(Component):
    24     """abstract base class for additinal components displayed in content
    23     """abstract base class for additinal components displayed in content
    30     it should be configured using .accepts, .etype, .rtype, .target and
    29     it should be configured using .accepts, .etype, .rtype, .target and
    31     .context class attributes
    30     .context class attributes
    32     """
    31     """
    33     
    32     
    34     __registry__ = 'contentnavigation'
    33     __registry__ = 'contentnavigation'
    35     __registerer__ = accepts_registerer    
       
    36     __select__ = one_line_rset() & primary_view() & match_context_prop()
    34     __select__ = one_line_rset() & primary_view() & match_context_prop()
    37     registered = accepts_compat(has_relation_compat(condition_compat(View.registered)))
    35     registered = accepts_compat(has_relation_compat(condition_compat(View.registered)))
    38     
    36     
    39     property_defs = {
    37     property_defs = {
    40         _('visible'):  dict(type='Boolean', default=True,
    38         _('visible'):  dict(type='Boolean', default=True,