Provide a generic and ergonomic relation widget
Project description
Provide a generic and ergonomic relation widget
How to use it
Add the widget in your uicfg.py file via uicfg configuration tool.
If you are using cubicweb.web.uihelper.FormConfig:
from cubicweb.web import uihelper from cubes.relationwidget.views import RelationFacetWidget class MyEntityConfing(uihelper.FormConfig): etype = 'MyEntity' rels_as_attrs = ('my_relation', ) # edit the relation as attribut widgets = dict( my_relation=RelationFacetWidget, # use the RelationFacetWidget for `my_relation` )
You can also use it directely via uicfg.autoform_field_kwarg:
from cubicweb.web.views import uicfg from cubes.relationwidget.views import RelationFacetWidget # edit the relation as attribute. uicfg.autoform_section.tag_subject_of(('MyEntity', 'my_relation', '*'), formtype=('main', 'muledit'), section='attributes') # add the RelationFacetWidget for `my_relation` uicfg.autoform_field_kwargs.tag_subject_of(('MyEntity', 'my_relation', '*'), {'widget': RelationFacetWidget})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for cubicweb-relationwidget-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67f4347c71a5facecbe552382b6ab84786f2de7490f9b6d62111d42f40edc0e6 |
|
MD5 | 7a47e0a059e02ad27afc9e221c49cb97 |
|
BLAKE2b-256 | 4cf98f5eb244a868cf9dee99a80ab053b04652f63d8db530fded0a24b88b63c7 |