Skip to content

DataFilterCondition

DataFilterCondition(fields, *, selected='', op='', value=None, row_path='', region_id='mim-list-region')

Bases: Component

One ServiceNow-style condition row: field ▾ / operator ▾ / typed value / remove. Changing the field select hx-GETs row_path?field=<key> and swaps this row’s outerHTML with the re-typed row. fields is the full pickable set (for the field select); selected is the active field; op / value prefill the operator + value on a re-render / active condition.

Functions:

  • render –

Attributes:

  • fields –
  • op –
  • region_id –
  • row_path –
  • selected –
  • value –
fields = tuple(fields)
op = op or (self._current.ops[0] if self._current and self._current.ops else '')

moderatorim.ui.DataFilterCondition.region_id

Section titled “moderatorim.ui.DataFilterCondition.region_id”
region_id = region_id
render()

moderatorim.ui.DataFilterCondition.row_path

Section titled “moderatorim.ui.DataFilterCondition.row_path”
row_path = row_path

moderatorim.ui.DataFilterCondition.selected

Section titled “moderatorim.ui.DataFilterCondition.selected”
selected = selected or (self.fields[0].key if self.fields else '')
value = value