simput

class trame.widgets.simput.Simput(ui_manager, prefix=None, children=None, **kwargs)

Bases: AbstractElement

Simput data management component. This must be registered as the root of a layout to provide children with Simput data.

Parameters:
  • ui_manager – See simput docs |simput_link| for more info

  • domains_manager – See simput docs |simput_link| for more info

  • prefix (str | None) – Constructing a Simput component will set several variables, optionally prefixed by a namespace

  • query (str) – String filtering

  • children (str | list[trame.html.*] | trame.html.* | None) – The children nested within this element

>>> simput_widget = simput.Simput(ui_manager, prefix="myForm")
>>> simput_widget.register_layout(layout)
property helper

Simput helper object

apply(**kwargs)

Flush modified properties so they can be pushed to their concrete objects

reset(**kwargs)

Unapply properties

push(id=None, type=None, domains=None, proxy=None, **kwargs)

Ask server to push data, ui, or constraints

update(change_set, **kwargs)

List of properties and value to update

>>> change_set = [
... {"id":"12", "name":"Radius", "value": 0.75},
... {"id": "12", "name":"Resolution", "value": 24}
... ]
register_layout(layout)

Register self to the root of the layout and clear any previously registered elements (to support hot reloading)

property changeset

All unapplied changesets

property has_changes

Does the changeset have content?

property auto_update

Whether to automatically apply changes

class trame.widgets.simput.SimputItem(children=None, extract=[], **kwargs)

Bases: AbstractElement

Simput data display component. This must be child of a Simput component to have access to Simput data. See simput docs |simput_link| for more info.

Parameters:
  • item_id (str) – The simput id of the data to display

  • extract (list[str]) – Columns to make available from this component to its children

  • no_ui (bool) – Whether to show simput template UI

  • v_slot (str) – Fields to be pass to slot template (i.e.: data, ui, domain, properties, all…)

  • children (str | list[trame.html.*] | trame.html.* | None) – The children nested within this element

Events

Parameters:

dirty (function) – Function to call when itemId is changed