diff -r c929360212ca -r 920079cb4e5b web/uicfg.py --- a/web/uicfg.py Tue Sep 08 21:57:45 2009 +0200 +++ b/web/uicfg.py Wed Sep 09 09:56:47 2009 +0200 @@ -164,23 +164,28 @@ def init_autoform_section(rtag, sschema, rschema, oschema, role): if rtag.get(sschema, rschema, oschema, role) is None: - if role == 'subject': - card = rschema.rproperty(sschema, oschema, 'cardinality')[0] - composed = rschema.rproperty(sschema, oschema, 'composite') == 'object' - else: - card = rschema.rproperty(sschema, oschema, 'cardinality')[1] - composed = rschema.rproperty(sschema, oschema, 'composite') == 'subject' - if sschema.is_metadata(rschema): + if autoform_is_inlined.get(sschema, rschema, oschema, role): + section = 'generated' + elif sschema.is_metadata(rschema): section = 'metadata' - elif card in '1+': - if not rschema.is_final() and composed: - section = 'generated' + else: + if role == 'subject': + card = rschema.rproperty(sschema, oschema, 'cardinality')[0] + composed = rschema.rproperty(sschema, oschema, 'composite') == 'object' else: - section = 'primary' - elif rschema.is_final(): - section = 'secondary' - else: - section = 'generic' + card = rschema.rproperty(sschema, oschema, 'cardinality')[1] + composed = rschema.rproperty(sschema, oschema, 'composite') == 'subject' + if card in '1+': + if not rschema.is_final() and composed: + # XXX why? probably because we want it unlined, though this + # is not the case by default + section = 'generated' + else: + section = 'primary' + elif rschema.is_final(): + section = 'secondary' + else: + section = 'generic' rtag.tag_relation((sschema, rschema, oschema, role), section) autoform_section = RelationTags('autoform_section', init_autoform_section,