[Cubicweb] Display of inlined entities

Stephane Bugat stephane.bugat at free.fr
Fri Aug 3 10:32:08 CEST 2012


Dear all,

The `question & answer` cubicweb summer continues...

My purpose will be about inline relations and the ways to display them. 
I've found for instance that it is possible to edit both inline-related 
entities very conveniently using ``uicfg.autform_section``:

     _afs = uicfg.autoform_section
     _afs.tag_subject_of(('Person', 'based_in', '*'), 'main', 'inlined')

A pity that this wonderful thing is not documented (I know, I should 
propose a documentation patch... We'll see it in a near future).

But, it would be also tremendous if both entities attributes could be 
displayed in the same attributes section of the view of the first 
entity... For instance, taking the latter example:

     _pvs = uicfg.primaryview_section
     _pvs.tag_subject_of(('Person', 'based_in', '*'), 'inlined')

For the moment I have to do it by customizing the primary view 
'render_entity_attributes()' method of the first entity and adding the 
'render_entity_attributes()' of the second inlined entity in it... Not 
optimized as it displays 2 tables (one for each attributes set) that do 
not have the same column size...

Stephane



More information about the Cubicweb mailing list