equal
deleted
inserted
replaced
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 |