Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cubicweb-relationwidget-0.3.2.tar.gz (14.9 kB view details)

Uploaded Source

File details

Details for the file cubicweb-relationwidget-0.3.2.tar.gz.

File metadata

File hashes

Hashes for cubicweb-relationwidget-0.3.2.tar.gz
Algorithm Hash digest
SHA256 7b4a8f7ec26a485875537cce8db7e8654ae9efcd89dd2fd5df643c938d32bf73
MD5 fb5f86f2a3bbca1317b4ab61e3a3159c
BLAKE2b-256 8726ed0fe92b9b57372ce76efe32b427613330d4d8bbdf87ae607730314452b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page