[Cubicweb] [CubicWeb / discussion] Improving uicfg

Nicolas Chauvat nicolas.chauvat at logilab.fr
Thu Dec 12 23:16:59 CET 2013


On Thu, Dec 12, 2013 at 07:36:02PM +0100, Vladimir Popescu wrote:
> 1. Be able to add RQL-computed rsets, e.g.
>        pvdc.add_to(('Subject', 'attributes'),
>                    {'rql': 'DISTINCT Any X WHERE ...'
>                            '<restrictions on X>...',
>                     'vid': '...', 'label': '...'}),
> 
>    or
>        pvdc.add_to(('Subject', 'attributes'),
>                    {'rql': 'Any COUNT(X) WHERE ...'
>                     '<restrictions on X>...', ...})
> 
>    where 'X' is implicitly the Subject. Here, we would use
>    'attributes' or 'relations', depending on the nature of
>    the computed rset.

Sounds like the "rules" Léa has been working on, isn't it?

If you had rules in the schema, you could use them in the
PrimaryView. Or am I misunderstanding your proposal?

> 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 ...)
>
> [..]
> 
> 3. Be able to specify a property / method defined in entities.py
>    instead of the schema definitions, as in
> 
>        pvdc.add_to(('Subject', 'attributes'),
>                    {'property': 'bar', ...})  
> 
>    where 'bar' is defined in entities.py for 'Subject'.

Interesting ideas.

-- 
Nicolas Chauvat

logilab.fr - services en informatique scientifique et gestion de connaissances  



More information about the Cubicweb mailing list