[uicfg] fix handling of 'order' in the primaryview_display_ctrl rtag: consider by default only schema order, not order of appearance of rules
--- a/web/uicfg.py Wed May 12 15:25:17 2010 +0200
+++ b/web/uicfg.py Wed May 12 17:07:07 2010 +0200
@@ -80,18 +80,13 @@
primaryview_section = RelationTags('primaryview_section',
init_primaryview_section,
frozenset(('attributes', 'relations',
- 'sideboxes', 'hidden')))
+ 'sideboxes', 'hidden')))
class DisplayCtrlRelationTags(RelationTagsDict):
def __init__(self, *args, **kwargs):
super(DisplayCtrlRelationTags, self).__init__(*args, **kwargs)
- self._counter = 0
-
- def tag_relation(self, key, tag):
- tag = super(DisplayCtrlRelationTags, self).tag_relation(key, tag)
- self._counter += 1
- tag.setdefault('order', self._counter)
+ self.counter = 0
def tag_subject_of(self, key, tag):
subj, rtype, obj = key
@@ -117,7 +112,8 @@
sschema = '*'
label = '%s_%s' % (rschema, role)
rtag.setdefault((sschema, rschema, oschema, role), 'label', label)
- rtag.setdefault((sschema, rschema, oschema, role), 'order', rtag._counter)
+ rtag.counter += 1
+ rtag.setdefault((sschema, rschema, oschema, role), 'order', rtag.counter)
primaryview_display_ctrl = DisplayCtrlRelationTags('primaryview_display_ctrl',
init_primaryview_display_ctrl)