Cube for the Brainomics Project, see http://www.brainomics.net/
Uicfg documentation
In Brainomics, we have experimented a new function for uicfg that allows to display specific rset/information within the ‘attributes’ or ‘relations’ sections of the primary view.
The display_rset method of uicfg take 3 arguments:
the name of the etype concerned by the rule;
the section where the information is displayed (attributes or relations);
a dictionnary of properties.
The dictionnary of properties must have:
a ‘callback’ item OR a ‘rql’ and a ‘vid’ items.
The ‘callback’ is a function that takes the entity and render an HTML snipet.
The ‘rql’ is a rql query where the variable ‘X’ is the current entity. The ‘vid’ is the __regid__ of the view that will be applied to the result of the rql query.
It could also have:
a ‘label’ (’’ if not given);
an ‘order’ (9999 if not given);
It should be used as follows, e.g. using an etype property:
>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'attributes',
{'callback': lambda x: x.formatted_description,
'label': _('description')})
or with a ‘rql’ and ‘vid’ attributes:
>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'relations',
{'rql': 'Any Z WHERE X relation1 Y, Y relation2 Z',
'vid': 'my-view',
'label': _('My label')})
or with a ‘callback’ using a view:
>>> _pvdc = uicfg.primaryview_display_ctrl
>>> _pvdc.display_rset('MyEtype', 'relations',
{'callback': lambda x: x.view('my-secondary-view'),
'order': 2,
'label': _('My label')})
Release files for cubicweb-brainomics 0.12.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cubicweb-brainomics-0.12.0.tar.gz | 204.9 kB | Details |
Release files / cubicweb-brainomics-0.12.0.tar.gz
| Download URL | cubicweb-brainomics-0.12.0.tar.gz |
|---|---|
| Size | 204.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b62f9876f31ce28c6d47384256447bc2c009bf59d4ecb366b1ef3771f389a1e
|
|
BLAKE2b-256 checksum How to use checksums |
9ab48193d1cdc9951ed9710e4f14b21f279bdd85c0bd43b8dddaba6eb91c77b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |