[Cubicweb] [CubicWeb / discussion] Improving uicfg
Vladimir Popescu
vladimir.popescu at logilab.fr
Tue Dec 17 16:13:40 CET 2013
Hi,
On 12/12/2013 23:16, Nicolas Chauvat wrote:
> 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?
Yes, I think the rules might be a way of implementing this proposal.
Besides, in this way perhaps the distinction between RQL-computed
attributes / relations and
attributes / relations computed "on the Python side" would be
transparent to the user.
>
>> 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.
>
I guess having rules in the schema would help us render the distinction
between 2 and 3 more transparent.
Best,
Vladimir
More information about the Cubicweb
mailing list