# HG changeset patch # User Sylvain Thénault # Date 1246284548 -7200 # Node ID 08c66a83c3ca8b1664baa994816779dd78df716a # Parent 3a57c8173290b197b57c4e3683783e65105cbdc8 don't use reledit for composite relations diff -r 3a57c8173290 -r 08c66a83c3ca web/views/primary.py --- a/web/views/primary.py Mon Jun 29 16:06:48 2009 +0200 +++ b/web/views/primary.py Mon Jun 29 16:09:08 2009 +0200 @@ -115,7 +115,19 @@ def render_entity_attributes(self, entity, siderelations=None): for rschema, tschemas, role, dispctrl in self._section_def(entity, 'attributes'): - vid = dispctrl.get('vid', 'reledit') + # don't use reledit as default vid for composite relation + if rschema.is_final(): + defaultvid = 'reledit' + # XXX use entity.e_schema.role_rproperty(role, rschema, 'composite', tschemas[0]) once yams > 0.23.0 is out + elif role == 'subject' and \ + rschema.rproperty(entity.e_schema, tschemas[0], 'composite'): + defaultvid = 'csv' + elif role == 'object' and \ + rschema.rproperty(tschemas[0], entity.e_schema, 'composite'): + defaultvid = 'csv' + else: + defaultvid = 'reledit' + vid = dispctrl.get('vid', defaultvid) if rschema.is_final() or vid == 'reledit': value = entity.view(vid, rtype=rschema.type, role=role) else: