BloomERP

Built-ins

DataviewTypeDefinition

Connect a dataview’s configuration to its renderer and picker metadata.

Register a definition from your app’s discovered dataviews module. Its ID must match the default value of the configuration’s view_type. The renderer can reuse an existing renderer or provide its own templates.

SettingTypeDefaultDescription
idstrRequiredStable ID stored in the dataview configuration.
documentationstr''Markdown and tagged examples included in the generated developer reference.
labelstr | PromiseRequiredName shown in the dataview picker.
descriptionstr | PromiseRequiredSummary shown when choosing a dataview.
iconstrRequiredIcon shown for this dataview type.
renderer_clstype[BaseDataviewRenderer]RequiredRenderer class and templates used to display the dataview.
config_clstype[BaseDataview]RequiredPydantic model for the dataview's options.
requires_display_fieldsboolTrueWhether the editor requires display fields for this type.
available_for_modelCallable[[type[Model]], bool]_available_for_any_modelCallback that decides whether a model can use this dataview.
record_basedboolTrueWhether the dataview renders individual records.

Register a compact table view

Give the variant its own configuration type and reuse the standard table renderer.

python
from typing import Literal

from pydantic import Field

from bloomerp.dataviews.definition import DataviewTypeDefinition
from bloomerp.dataviews.registry import register_dataview
from bloomerp.dataviews.table.config import TableDataView
from bloomerp.dataviews.table.renderer import TableDataviewRenderer


class CompactTable(TableDataView):
    '''Start with ten rows per page.'''

    view_type: Literal["example_compact_table"] = "example_compact_table"
    page_size: Literal[10, 25, 50, 100] = Field(default=10)


register_dataview(
    DataviewTypeDefinition(
        id="example_compact_table",
        label="Compact table",
        description="A table that starts with ten rows per page.",
        icon="fa-solid fa-table",
        config_cls=CompactTable,
        renderer_cls=TableDataviewRenderer,
    )
)

Offer a dataview on one model

Use an availability callback to offer a view only on the To-do model.

python
from typing import Literal

from django.db.models import Model

from bloomerp.dataviews.definition import DataviewTypeDefinition
from bloomerp.dataviews.registry import register_dataview
from bloomerp.dataviews.table.config import TableDataView
from bloomerp.dataviews.table.renderer import TableDataviewRenderer
from bloomerp.models.project_management.todo import Todo


def is_todo_model(model: type[Model]) -> bool:
    '''Offer this view on To-do records.'''
    return model is Todo


class TodoReviewTable(TableDataView):
    '''Identify the table variant for reviewing To-dos.'''

    view_type: Literal["example_todo_review"] = "example_todo_review"


register_dataview(
    DataviewTypeDefinition(
        id="example_todo_review",
        label="To-do review table",
        description="A table available on the To-do model.",
        icon="fa-solid fa-list-check",
        config_cls=TodoReviewTable,
        renderer_cls=TableDataviewRenderer,
        available_for_model=is_todo_model,
    )
)

Table

ID table

Displays records in a sortable table.

FieldValue
iconfa fa-table
requires_display_fieldsTrue
record_basedTrue

TableDataView

Compare records side by side in rows and columns.

Choose the columns and their order, set an initial sort, and control how many records appear per page. Readers can sort supported columns and use filters to narrow the list. Use a table when scanning across fields matters, such as reviewing invoice amounts, due dates, and statuses together.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the dataview displays record details.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'datatable'Registered component that renders the table body.
view_typeLiteral['table']'table'Select the table view.
page_sizeLiteral[10, 25, 50, 100]25The number of records shown on each page.
sort_fieldstr | NoneNoneThe field used for table sorting.
sort_directionLiteral['asc', 'desc']'asc'The direction used for table sorting.

Kanban

ID kanban

Displays records in a kanban board.

FieldValue
iconfa fa-columns
requires_display_fieldsTrue
record_basedTrue

KanbanDataView

Organize records into lanes based on a field such as status.

Combine several values into a custom lane, arrange and color the lanes, and sort cards within each lane. When the grouping field is editable, dragging a card to a compatible lane updates that field. Use Kanban to see where work is queued, in progress, or ready for review.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the dataview displays record details.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'kanban-board'Registered component that renders the Kanban board.
view_typeLiteral['kanban']'kanban'Select the Kanban board.
group_by_fieldstr | NoneNoneField whose values determine which lane each card belongs to.
custom_groupingsdict[str, list[str]]{}Map custom lane names to grouping values to combine in each lane.
custom_group_orderlist[str][]Custom lane names in display order.
show_unmapped_lanesboolTrueShow individual lanes for values outside the custom groups.
lane_colouringdict[str, str]{}Map lane names or grouping values to six-digit hex colors.
page_sizeLiteral[10, 25, 50, 100]25The number of cards initially shown in each lane.
sort_fieldstr | NoneNoneField used to sort cards in each lane.
sort_directionLiteral['asc', 'desc']'asc'Choose ascending or descending order within each lane.

Card

ID card

Displays records in a card grid.

FieldValue
iconfa fa-id-card
requires_display_fieldsTrue
record_basedTrue

CardDataView

Browse records in a grid with one card per record.

Each card shows the record's label, selected fields, and any available record actions. Use cards when readers benefit from seeing each record as a unit, such as browsing contacts or a product catalog.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the dataview displays record details.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'card-view'Registered component that renders the card grid.
view_typeLiteral['card']'card'Select the card grid.
page_sizeLiteral[10, 25, 50, 100]25The number of cards shown on each page.

Calendar

ID calendar

Displays records in a calendar view.

FieldValue
iconfa fa-calendar
requires_display_fieldsTrue
record_basedTrue

CalendarDataView

See dated records on a calendar or in a chronological list.

Map model fields to event dates or times. You can show timed events and all-day events together, choose a day, week, month, year, or list view, and color events by a field such as status. Use a calendar for appointments, deadlines, or other records you want to find by date.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'drawer'Choose how the calendar opens the details of a selected event.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'calendar'Registered component that renders the calendar body.
view_typeLiteral['calendar']'calendar'Select the calendar view.
start_fieldstr | NoneNoneDate or date-time field that places the start of each event.
end_fieldstr | NoneNoneDate or date-time field that sets the end of each event range.
start_date_fieldstr | NoneNoneStart date for an all-day event. Configure this with end_date_field.
end_date_fieldstr | NoneNoneExclusive end date for an all-day event. Configure this with start_date_field.
calendar_view_modeLiteral['day', 'week', 'month', 'year', 'list']'week'Calendar period or list layout to display by default.
color_grouping_fieldstr | NoneNoneField whose values determine event colors and the legend.

Gantt

ID gantt

Displays records in a Gantt chart.

FieldValue
iconfa fa-chart-gantt
requires_display_fieldsTrue
record_basedTrue

GanttDataView

Plan work on a timeline, with each record spanning a start and end date.

Compare overlapping work and draw dependency links using relations to other records of the same model. Readers can zoom the timeline and, where the scheduling fields are editable, move or resize bars.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[]Field names to display beside each record on the timeline.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the dataview displays record details.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'gant-chart'Registered component that renders the Gantt timeline.
view_typeLiteral['gantt']'gantt'Select the Gantt chart.
start_fieldstrRequiredField that sets the beginning of a timeline bar.
end_fieldstrRequiredField that sets the end of a timeline bar.
dependency_from_fieldstr | NoneNoneSelf-referencing relation for the record that precedes this one.
dependency_for_fieldstr | NoneNoneSelf-referencing relation for the record that follows this one.
page_sizeLiteral[10, 25, 50, 100]25The number of timeline rows loaded at a time.
orderingstr | NoneNoneField used to order timeline rows.
ordering_directionLiteral['asc', 'desc']'asc'Choose ascending or descending order for timeline rows.

Pivot

ID pivot_table

Displays records in a pivot table.

FieldValue
iconfa fa-table
requires_display_fieldsTrue
record_basedFalse

PivotTableDataView

Summarize filtered records by grouping them into rows and columns.

Choose the fields to group by and aggregate, expand nested rows to see finer groups, and show totals for the current page or the entire filtered dataset. Use a pivot table to answer questions such as how many to-dos there are at each combination of status and priority.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the dataview displays record details.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'pivot-table'Registered component that renders the pivot table.
view_typeLiteral['pivot_table']'pivot_table'Select the pivot table.
row_fieldslist[str][]Fields that define the expandable row hierarchy.
column_fieldslist[str][]Fields that define the nested column headers.
value_fieldslist[str][]Fields whose values are aggregated into the pivot cells.
aggregationLiteral['count', 'sum', 'min', 'max', 'avg']'count'Operation applied to each value field. Numeric fields support every operation, booleans support sum and count, and other fields use count.
show_row_totalsboolTrueShow totals at the end of each row.
show_column_totalsboolTrueShow totals beneath the columns.
totals_scopeLiteral['page', 'dataset']'page'Calculate the totals row from the current page or the entire filtered dataset.
page_sizeLiteral[10, 25, 50, 100]25The number of top-level pivot rows shown on each page.

File Browser

ID file_browser

File browser

FieldValue
iconfa fa-file
requires_display_fieldsFalse
record_basedTrue

FileBrowserDataview

Browse files in stored folders or by the records they are attached to.

Use physical folders to navigate the stored file hierarchy. Use virtual folders to find attachments by model and record. In a model-scoped view, you can also include files attached to records reached through selected relations, such as documents attached to a project's tasks.

SettingTypeDefaultDescription
namestr'Default'Name of the dataview.Minimum length: 1Maximum length: 255
is_defaultboolTrueSelect this dataview as the model's default.
display_fieldslist[str][]Field names to display, in display order.
default_filtersdict[str, str | list[str]]{}Initial filter query parameters and values.
view_modeLiteral['normal', 'split', 'drawer']'normal'Choose how the browser opens record details on selection.
item_click_action_idstr | NoneNoneRegistered Object Action ID to run on click. If unset, open record details.Minimum length: 1
component_argsdict[str, str]{}Arguments passed to the dataview component.
container_component_idstr'dataview-container'Registered component for the dataview container.
dataview_component_idstr | None'file-browser'Registered component that renders the file browser.
view_typeLiteral['file_browser']'file_browser'Select the file browser.
related_fieldsdict[int, list[str]]{}Map host model content type IDs to relation names whose attached files should be included.
folder_typeLiteral['virtual', 'physical']'virtual'Browse files by their linked records or by stored folders.