BloomERP

Built-ins

TileTypeDefinition

Connect a workspace tile’s picker entry to its configuration and renderer.

The module or model supplies an instance of the registered configuration. Workspace layouts reference that instance by its tile ID. The registry key identifies the tile type itself.

SettingTypeDefaultDescription
idstrRequiredStable identifier used by this definition.Minimum length: 1
documentationstr''Markdown and tagged examples included in the generated developer reference.
namestrRequiredName shown in the tile picker.
descriptionstrRequiredSummary of what the tile displays or does.
iconstr''Icon shown in the tile picker.
form_clsOptional[Type[Form]]NoneDjango form class used to edit this tile.
modelOptional[Type[BaseTileConfig]]NonePydantic configuration class used to validate saved tile settings.
render_clsOptional[Type[BaseTileRenderer]]NoneRenderer class used to render a configured tile.
filter_fields_factoryCallable[[BaseTileConfig], list[FilterField]]TileTypeDefinition.<lambda>Callback that exposes a configured tile's workspace filter fields.

Register a tile with typed settings and a renderer

Define a small configuration model and render the message using Django’s HTML escaping.

python
from typing import Self

from django.http import HttpRequest
from django.utils.html import format_html
from pydantic import Field

from bloomerp.workspaces.base import BaseTileConfig, BaseTileRenderer, TileOperationDefinition, TileTypeDefinition
from bloomerp.workspaces.registry import TILE_TYPE_REGISTRY


class NoticeTileConfig(BaseTileConfig):
    '''Store the text displayed in a notice tile.'''

    message: str = Field(default="Dispatch is open.", description="Text shown to users.")

    @classmethod
    def get_default(cls) -> Self:
        '''Build a notice with the default message.'''
        return cls()

    @classmethod
    def get_operation(cls, operation: str) -> TileOperationDefinition:
        '''Reject operations because the notice has no interactive controls.'''
        raise KeyError(operation)


class NoticeTileRenderer(BaseTileRenderer):
    '''Render the notice as an escaped paragraph.'''

    @classmethod
    def render(cls, config: NoticeTileConfig, request: HttpRequest) -> str:
        '''Return the configured message inside a paragraph.'''
        return format_html("<p>{}</p>", config.message)


TILE_TYPE_REGISTRY.register(
    TileTypeDefinition(
        id="EXAMPLE_NOTICE_TILE",
        name="Notice",
        description="Show a short notice on a workspace.",
        model=NoticeTileConfig,
        render_cls=NoticeTileRenderer,
    ),
)

Place the new tile on a module workspace

Use the notice configuration from the previous example. Match the layout item ID to the configured tile ID.

python
from bloomerp.models.definition import LayoutItem, LayoutRow, WorkspaceLayout
from bloomerp.modules.definition import BloomerpModule


class DispatchWorkspaceModule(BloomerpModule):
    '''Publish a dispatch workspace with a notice tile.'''

    id = "dispatch_board"
    name = "Dispatch board"
    tiles = [
        NoticeTileConfig(id="dispatch-notice", message="Review today's deliveries."),
    ]
    workspaces = [
        WorkspaceLayout(
            rows=[LayoutRow(columns=1, items=[LayoutItem(id="dispatch-notice")])],
        ),
    ]

Analytics Tile

ID ANALYTICS_TILE

Visualizes data from a custom query and presents it in a structured format such as a chart, KPI, table, or pie chart.

FieldValue
iconfa-chart-line

AnalyticsTileConfig

Session-backed configuration for an analytics tile being built.

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
querystrRequiredRead-only SQL query supplying the tile's data. Selected field names must match columns or aliases returned by this query.
typestrRequiredAnalytics subtype key. Select the matching oneOf branch for its field slots and options.
fieldsdict[str, list[FieldConfig]]{}Selected query columns grouped by the chosen subtype's field slots.
optsdict{}Tile-level display options for the chosen analytics subtype.
filterslist[AnalyticsTileFilter][]Columns available to interactive tile/workspace filters, as a list of {field, type, shared_key?} registrations. These are not active conditions: do not put lookup/operator/value here or use fields.filter. Conditions are supplied by the filter UI at request time and applied to the SQL result via SELECT * FROM (query) ... WHERE ..., after SQL aggregation. For a permanent restriction or filtering rows before COUNT/GROUP BY, put the predicate in query's WHERE clause. An empty list exposes no interactive filter columns.

Canvas

ID CANVAS_TILE

A free-form workspace where users can add and arrange different types of content such as text, media, and embedded components.

FieldValue
iconfa-palette

CanvasTileConfig

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
contentdict[str, Any]{}—
heightint384At least: 256At most: 1600

ID LINKS_TILE

Provides quick access to a collection of internal or external links, allowing users to navigate efficiently to frequently used resources.

FieldValue
iconfa-link

LinkTileConfig

Configuration for a tile displaying navigation links and nested folders.

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
linkslist[Link]RequiredOrdered top-level links and folders displayed on the tile. Nest items in a folder's children. This list is required; an empty list creates an empty tile.

Text

ID TEXT_TILE

Displays simple markdown content such as notes, instructions, or reference text.

FieldValue
iconfa-align-left

TextTileConfig

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
markdownstr''—

Data View

ID DATAVIEW_TILE

Displays and manages records from a selected model in a structured view with filtering, sorting, and interaction capabilities.

FieldValue
iconfa-table

DataViewTileConfig

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
content_type_idint | NoneNone—
list_view_preference_idint | NoneNone—
actionslist[str] | NoneNone—
initial_query_paramsdict[str, object]{}Query parameters applied when the data view tile is rendered.

Form

ID FORM_TILE

Displays a form, containing inputs, etc.

FieldValue
iconfa-rectangle-list

FormTileConfig

SettingTypeDefaultDescription
idstr | NoneNone—
namestr | NoneNone—
descriptionstr | NoneNone—
iconstr | NoneNone—
filter_shared_keysdict[str, str | None]{}Workspace filter aliases by field name. Omitted fields share by name; null keeps a field tile-specific.
form_idstrRequired—