7 :organization: Logilab |
7 :organization: Logilab |
8 :copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
8 :copyright: 2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
9 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
9 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
10 """ |
10 """ |
11 __docformat__ = "restructuredtext en" |
11 __docformat__ = "restructuredtext en" |
12 from cubicweb.rtags import RelationTags |
12 |
|
13 from cubicweb.rtags import RelationTags, RelationTagsSet |
13 |
14 |
14 # autoform.AutomaticEntityForm configuration ################################## |
15 # autoform.AutomaticEntityForm configuration ################################## |
15 |
16 |
16 # relations'category (eg primary/secondary/generic/metadata/generated) |
17 # relations'category (eg primary/secondary/generic/metadata/generated) |
17 rcategories = RelationTags() |
18 rcategories = RelationTags() |
18 # use primary and not generated for eid since it has to be an hidden |
19 # use primary and not generated for eid since it has to be an hidden |
19 rcategories.set_rtag('primary', 'eid', 'subject') |
20 rcategories.tag_relation('primary', ('*', 'eid', '*'), 'subject') |
20 rcategories.set_rtag('primary', 'in_state', 'subject') |
21 rcategories.tag_relation('primary', ('*', 'in_state', '*'), 'subject') |
21 rcategories.set_rtag('secondary', 'description', 'subject') |
22 rcategories.tag_relation('secondary', ('*', 'description', '*'), 'subject') |
22 rcategories.set_rtag('metadata', 'creation_date', 'subject') |
23 rcategories.tag_relation('metadata', ('*', 'creation_date', '*'), 'subject') |
23 rcategories.set_rtag('metadata', 'modification_date', 'subject') |
24 rcategories.tag_relation('metadata', ('*', 'modification_date', '*'), 'subject') |
24 rcategories.set_rtag('metadata', 'owned_by', 'subject') |
25 rcategories.tag_relation('metadata', ('*', 'owned_by', '*'), 'subject') |
25 rcategories.set_rtag('metadata', 'created_by', 'subject') |
26 rcategories.tag_relation('metadata', ('*', 'created_by', '*'), 'subject') |
26 rcategories.set_rtag('generated', 'has_text', 'subject') |
27 rcategories.tag_relation('generated', ('*', 'has_text', '*'), 'subject') |
27 rcategories.set_rtag('generated', 'is', 'subject') |
28 rcategories.tag_relation('generated', ('*', 'is', '*'), 'subject') |
28 rcategories.set_rtag('generated', 'is', 'object') |
29 rcategories.tag_relation('generated', ('*', 'is', '*'), 'object') |
29 rcategories.set_rtag('generated', 'is_instance_of', 'subject') |
30 rcategories.tag_relation('generated', ('*', 'is_instance_of', '*'), 'subject') |
30 rcategories.set_rtag('generated', 'is_instance_of', 'object') |
31 rcategories.tag_relation('generated', ('*', 'is_instance_of', '*'), 'object') |
31 rcategories.set_rtag('generated', 'identity', 'subject') |
32 rcategories.tag_relation('generated', ('*', 'identity', '*'), 'subject') |
32 rcategories.set_rtag('generated', 'identity', 'object') |
33 rcategories.tag_relation('generated', ('*', 'identity', '*'), 'object') |
33 rcategories.set_rtag('generated', 'require_permission', 'subject') |
34 rcategories.tag_relation('generated', ('*', 'require_permission', '*'), 'subject') |
34 rcategories.set_rtag('generated', 'wf_info_for', 'subject') |
35 rcategories.tag_relation('generated', ('*', 'wf_info_for', '*'), 'subject') |
35 rcategories.set_rtag('generated', 'wf_info_for', 'object') |
36 rcategories.tag_relation('generated', ('*', 'wf_info_for', '*'), 'object') |
36 rcategories.set_rtag('generated', 'for_user', 'subject') |
37 rcategories.tag_relation('generated', ('*', 'for_user', '*'), 'subject') |
37 rcategories.set_rtag('generated', 'for_user', 'object') |
38 rcategories.tag_relation('generated', ('*', 'for_user', '*'), 'object') |
38 |
39 |
39 # relations'field class |
40 # relations'field class |
40 rfields = RelationTags() |
41 rfields = RelationTags() |
41 |
42 |
42 # relations'widget class |
43 # relations'widget class |
48 rinlined = RelationTags() |
49 rinlined = RelationTags() |
49 |
50 |
50 # set of tags of the form <action>_on_new on relations. <action> is a |
51 # set of tags of the form <action>_on_new on relations. <action> is a |
51 # schema action (add/update/delete/read), and when such a tag is found |
52 # schema action (add/update/delete/read), and when such a tag is found |
52 # permissions checking is by-passed and supposed to be ok |
53 # permissions checking is by-passed and supposed to be ok |
53 rpermissions_overrides = RelationTags(use_set=True) |
54 rpermissions_overrides = RelationTagsSet() |
54 |
55 |
55 |
56 |
56 # boxes.EditBox configuration ################################################# |
57 # boxes.EditBox configuration ################################################# |
57 |
58 |
58 # 'link' / 'create' relation tags, used to control the "add entity" submenu |
59 # 'link' / 'create' relation tags, used to control the "add entity" submenu |
59 rmode = RelationTags() |
60 rmode = RelationTags() |
60 rmode.set_rtag('link', 'is', 'subject') |
61 rmode.tag_relation('link', ('*', 'is', '*'), 'subject') |
61 rmode.set_rtag('link', 'is', 'object') |
62 rmode.tag_relation('link', ('*', 'is', '*'), 'object') |
62 rmode.set_rtag('link', 'is_instance_of', 'subject') |
63 rmode.tag_relation('link', ('*', 'is_instance_of', '*'), 'subject') |
63 rmode.set_rtag('link', 'is_instance_of', 'object') |
64 rmode.tag_relation('link', ('*', 'is_instance_of', '*'), 'object') |
64 rmode.set_rtag('link', 'identity', 'subject') |
65 rmode.tag_relation('link', ('*', 'identity', '*'), 'subject') |
65 rmode.set_rtag('link', 'identity', 'object') |
66 rmode.tag_relation('link', ('*', 'identity', '*'), 'object') |
66 rmode.set_rtag('link', 'owned_by', 'subject') |
67 rmode.tag_relation('link', ('*', 'owned_by', '*'), 'subject') |
67 rmode.set_rtag('link', 'created_by', 'subject') |
68 rmode.tag_relation('link', ('*', 'created_by', '*'), 'subject') |
68 rmode.set_rtag('link', 'require_permission', 'subject') |
69 rmode.tag_relation('link', ('*', 'require_permission', '*'), 'subject') |
69 rmode.set_rtag('link', 'wf_info_for', 'subject') |
70 rmode.tag_relation('link', ('*', 'wf_info_for', '*'), 'subject') |
70 rmode.set_rtag('link', 'wf_info_for', 'object') |
71 rmode.tag_relation('link', ('*', 'wf_info_for', '*'), 'object') |