53 # primary view |
53 # primary view |
54 uicfg.actionbox_appearsin_addmenu.tag_object_of(('*', 'entry_of', 'Blog'), True) |
54 uicfg.actionbox_appearsin_addmenu.tag_object_of(('*', 'entry_of', 'Blog'), True) |
55 """ |
55 """ |
56 |
56 |
57 from itertools import repeat |
57 from itertools import repeat |
58 |
|
59 from six import string_types |
|
60 |
58 |
61 from cubicweb import neg_role |
59 from cubicweb import neg_role |
62 from cubicweb.rtags import (RelationTags, RelationTagsBool, RelationTagsSet, |
60 from cubicweb.rtags import (RelationTags, RelationTagsBool, RelationTagsSet, |
63 RelationTagsDict, NoTargetRelationTagsDict, |
61 RelationTagsDict, NoTargetRelationTagsDict, |
64 rtags_chain, _ensure_str_key) |
62 rtags_chain, _ensure_str_key) |
690 rdef = rschema.rdef(sschema, oschema) |
688 rdef = rschema.rdef(sschema, oschema) |
691 if not rdef.role_cardinality(role) in '?1' and rdef.composite == role: |
689 if not rdef.role_cardinality(role) in '?1' and rdef.composite == role: |
692 self.tag_relation((sschema, rschema, oschema, role), True) |
690 self.tag_relation((sschema, rschema, oschema, role), True) |
693 |
691 |
694 def _tag_etype_attr(self, etype, attr, desttype='*', *args, **kwargs): |
692 def _tag_etype_attr(self, etype, attr, desttype='*', *args, **kwargs): |
695 if isinstance(attr, string_types): |
693 if isinstance(attr, str): |
696 attr, role = attr, 'subject' |
694 attr, role = attr, 'subject' |
697 else: |
695 else: |
698 attr, role = attr |
696 attr, role = attr |
699 if role == 'subject': |
697 if role == 'subject': |
700 self.tag_subject_of((etype, attr, desttype), *args, **kwargs) |
698 self.tag_subject_of((etype, attr, desttype), *args, **kwargs) |