RmlDataModel¶
-
class RmlDataModel¶
Bases:
ReferenceCountHandle to an existing RmlUi data model. Obtained from
RmlContext::create_data_model()orRmlContext::get_data_model(). Usedirty_variable()/dirty_all()to notify RmlUi that Python-side data has changed so the DOM re-evaluates data-value / data-if / data-for.Inheritance diagram
digraph inheritance0ef611eccf { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "RmlDataModel" [URL="acron.rmlui.RmlDataModel.html#acron.rmlui.RmlDataModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ReferenceCount" -> "RmlDataModel" [arrowsize=0.75,style=""]; }- RmlDataModel.bind_dict_list()¶
Bind a list-of-records variable for data-for with per-field access. getter() must return a Python list of dicts (field name -> scalar). In RML, data-for=”row : name” then {{ row.field }} / data-if=”row.field” etc.
- RmlDataModel.bind_event_callback()¶
- RmlDataModel.bind_func()¶
- RmlDataModel.bind_list()¶
Bind a list-valued variable for use with data-for. getter() must return a Python list of scalars (bool/int/float/str). Call dirty_variable(name) after mutating the list to trigger DOM refresh.
- RmlDataModel.dirty_all()¶
- RmlDataModel.dirty_variable()¶
- RmlDataModel.is_valid()¶