Base View

Base view components for the UI Generator framework.

This module provides the foundational classes for building user interface views. It defines the abstract base class that all specific view types (tables, charts, forms, etc.) inherit from, as well as common UI components like action bars.

The BaseView class establishes the common interface and functionality shared across all views, including:

  • View identification and display properties

  • Title configuration with styling and positioning

  • Visibility control with conditional hiding

  • Action bars for interactive elements

  • Filter integration

All concrete view implementations (TableView, ChartView, FormView, etc.) extend BaseView to inherit this common functionality while adding their specific features.

Classes:
  • ActionBar: A horizontal container for interactive UI elements.

  • BaseView: Abstract base class for all view definitions.

class ActionBar(items=<factory>)[source]

Bases: Buildable

A UI container that displays a horizontal bar of interactive elements such as buttons, sliders, or text components. The action bar is typically used for presenting user controls related to a specific view, section, or workflow.

items

The list of UI elements to display within the action bar, rendered in order. Each element may represent an action, control, or informational display.

items: list[Element]
class BaseView(hidden=False, navigation_item=False)[source]

Bases: ABC, Buildable

Abstract base class for all view definitions. Handles common elements such as title.

Parameters:
  • display_name (str | None) – Optional name for display. Defaults to the ID of the underlying table.

  • hidden (bool) – If True, the view is not visible in the UI. Defaults to False

  • navigation_group (str | None) – Stores the navigation group to which the TableView is added, if any.

  • navigation_item (bool) – Check if the TableView is added to a navigation item.

title

The title to be displayed for the view, including optional styling and position (above or below content). Set via set_title().

Type:

Title | None

action_bar_definition

The action bar containing interactive UI elements for this view. Lazily instantiated when the first element is added via add_action_element().

Type:

ActionBar | None

show_filter

The name of the filter definition to display alongside this view. Set via set_show_filter().

Type:

str | None

nav_view_id

The ID of the associated navigation view, if this view is linked to a navigation item.

Type:

str | None

title: Title | None
action_bar_definition: ActionBar | None
show_filter: str | None
set_display_name(name)[source]

Sets the display name for this view.

Return type:

BaseView

set_navigation_group(group)[source]

Sets the navigation group this view belongs to.

Return type:

BaseView

set_title(value, style=None, position=Position.ABOVE_CONTENT)[source]

Sets the view title with optional style and position.

Parameters:
  • value (str) – The text value of the title.

  • style (BaseStyle | None) – Optional styling to apply to the title.

  • position (Position) – Where to place the title (above or below content).

add_permission_hidden_condition(hide_from_base_user)[source]

Adds a ModelPermissionsCondition to hide the view based on user permissions.

Parameters:

hide_from_base_user (bool) – If True, the view is hidden from base users and displayed to advanced users. If False, the opposite is true.

add_variable_hidden_condition(condition_variable, negate=False)[source]

Adds a conditional visibility rule that hides the view when the given variable evaluates to True (or False, when negated).

Parameters:
  • condition_variable (Field | Parameter | Calculation | ContextVariable) – The input representing the boolean condition that determines whether the view should be hidden.

  • negate (bool) – If True, the logical result of the condition is inverted. For example, a condition that normally hides when True will instead hide when False.

add_action_element(element)[source]

Adds a UI element to the action bar for this view or component.

If the action bar has not yet been created, this method will instantiate it before adding the element.

Parameters:

element (Element) – The UI element to add to the action bar.

set_show_filter(filter_name)[source]

Sets the filter to be shown for this view.

Parameters:

filter_name (str) – The filter definition to show. Its filter_name is used as the reference ID.

property id

Randomly generated unique identifier for this view.

property display_name

The human-readable display name shown in the UI.

property hidden

Whether this view is unconditionally hidden.

property hidden_conditions

The serialised hidden conditions list, or None if none have been added.

build()[source]

Serialise this view to a JSON-compatible dict.

Wraps the inner viewDefinition produced by super().build() inside a top-level envelope containing id, displayName, hidden, and hiddenConditions keys.

Returns:

The serialised view envelope.

Return type:

dict