sepal_ui.model.model.Model#
- class sepal_ui.model.model.Model(**kwargs)[source]#
Model object to store information of your computation (input, output.. etc).
The Model structure is based on traitlets and embed function for export or import in json format. The model traitlets can be bind to any widget field.
Attributes
Methods
Binding a widget input 'v_model' trait to a trait of the model.
Export a json description of all the object traitlets.
Import the model (i.e. the traitlets) from a json file.
- Parameters:
args (t.Any)
kwargs (t.Any)
- Return type:
t.Any
- Model.bind(widget, trait)[source]#
Binding a widget input ‘v_model’ trait to a trait of the model.
The binding will be unidirectionnal for the sake of some custom widget that does not support it. This wrapper avoid to import the ipywidgets lib everywhere and reduce the number of parameters Some existence check are also performed and will throw an error if the trait doesn’t exist.
- Parameters:
widget (VuetifyWidget) – any input widget with a v_model trait
trait (str) – the name of a trait of the current model
- Return type:
Self