rtags.py
branchstable
changeset 4931 92c9d0a5dc11
parent 4391 bd8480824e0b
child 5314 86e5abbebfaf
equal deleted inserted replaced
4928:cbca73dc9753 4931:92c9d0a5dc11
     1 """relation tags store
     1 #:organization: Logilab
     2 
     2 #:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     3 :organization: Logilab
     3 #:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     4 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     4 #:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 """
       
     7 A RelationTag object is an object which allows to link a configuration information to a relation definition. For instance, the standard primary view uses a RelationTag object (uicfg.primaryview_section) to get the section to display relations.
       
     8 
       
     9 .. sourcecode:: python
       
    10 
       
    11    # display ``entry_of`` relations in the ``relations`` section in the ``BlogEntry`` primary view
       
    12    uicfg.primaryview_section.tag_subject_of(('BlogEntry', 'entry_of', '*'),
       
    13                                              'relations')
       
    14 
       
    15    # hide every relation ``entry_of`` in the ``Blog`` primary view
       
    16    uicfg.primaryview_section.tag_object_of(('*', 'entry_of', 'Blog'), 'hidden')
       
    17 
       
    18 Three primitives are defined:
       
    19    * ``tag_subject_of`` tag a relation in the subject's context
       
    20    * ``tag_object_of`` tag a relation in the object's context
       
    21    * ``tag_attribute`` shortcut for tag_subject_of
       
    22 
       
    23 
     7 """
    24 """
     8 __docformat__ = "restructuredtext en"
    25 __docformat__ = "restructuredtext en"
     9 
    26 
    10 import logging
    27 import logging
    11 
    28