[rtags] override tag_xxx_of() methods in DisplayCtrlRelationTags to make sure a wildcard is used stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 29 Jun 2009 16:04:21 +0200
branchstable
changeset 2191 1f0fde12e35b
parent 2182 488099333160
child 2192 529edb6a6c96
[rtags] override tag_xxx_of() methods in DisplayCtrlRelationTags to make sure a wildcard is used
web/uicfg.py
--- a/web/uicfg.py	Sat Jun 27 00:59:36 2009 +0200
+++ b/web/uicfg.py	Mon Jun 29 16:04:21 2009 +0200
@@ -129,6 +129,21 @@
         self._counter += 1
         tag.setdefault('order', self._counter)
 
+    def tag_subject_of(self, key, tag):
+        subj, rtype, obj = key
+        if obj != '*':
+            self.warning('using explict target type in display_ctrl.tag_subject_of() '
+                         'has no effect, use (%s, %s, "*") instead of (%s, %s, %s)',
+                         subj, rtype, subj, rtype, obj)
+        super(DisplayCtrlRelationTags, self).tag_subject_of((subj, rtype, '*'), tag)
+
+    def tag_object_of(self, key, tag):
+        subj, rtype, obj = key
+        if subj != '*':
+            self.warning('using explict subject type in display_ctrl.tag_object_of() '
+                         'has no effect, use ("*", %s, %s) instead of (%s, %s, %s)',
+                         rtype, obj, subj, rtype, obj)
+        super(DisplayCtrlRelationTags, self).tag_object_of(('*', rtype, obj), tag)
 
 def init_primaryview_display_ctrl(rtag, sschema, rschema, oschema, role):
     if role == 'subject':