[Cubicweb] [CubicWeb / discussion] Improving uicfg

Sylvain Thénault sylvain.thenault at logilab.fr
Wed Dec 18 14:17:30 CET 2013


On 17 décembre 16:13, Vladimir Popescu wrote:
> >> 2. Be able to add a callback which generates e.g. custom HTML and /
> >>    or navigates through the paths between entities. For example:
> >>
> >>        pvdc.add_to(('Subject', 'attributes'),
> >>                    {'callback': 'foo', 'vid': '...', ....})
> >>
> >>        def foo(w, entity):
> >>            displayable_ent = entity.relation[0].attribute
> >>            w(... displayable_ent ...)

oOk, of all your proposition I think the "callable" one is the best as it allows
to enclause others. IMO what has to be reworked is the way we declare such
"additional" section.

primary_view_section has been mentioned, but I'm not sure it makes sense in that
case. My proposition would be something like:

  pvdc.insert_[before|after]( location, callback, label=None)

where `location` would be e.g. ('Subject', 'relation', 'subject'|'object') and
`callback` a callable accepting the view as argument and returning the html
snipped to be inserted. An optional `label` could be given.

Notice in that case the 'section' is depending on the section of `location`
relation, and I don't think we need anything else.

Regarding your concern about the target of the relation being ignored, it should
be treated as a separate issue, and I've no proper change proposition about this
right now.

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the Cubicweb mailing list