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.
| Setting | Type | Default | Description |
|---|---|---|---|
id | str | Required | Stable ID stored in the dataview configuration. |
documentation | str | '' | Markdown and tagged examples included in the generated developer reference. |
label | str | Promise | Required | Name shown in the dataview picker. |
description | str | Promise | Required | Summary shown when choosing a dataview. |
icon | str | Required | Icon shown for this dataview type. |
renderer_cls | type[BaseDataviewRenderer] | Required | Renderer class and templates used to display the dataview. |
config_cls | type[BaseDataview] | Required | Pydantic model for the dataview's options. |
requires_display_fields | bool | True | Whether the editor requires display fields for this type. |
available_for_model | Callable[[type[Model]], bool] | _available_for_any_model | Callback that decides whether a model can use this dataview. |
record_based | bool | True | Whether the dataview renders individual records. |
Register a compact table view
Give the variant its own configuration type and reuse the standard table renderer.
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.
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.
| Field | Value |
|---|---|
icon | fa fa-table |
requires_display_fields | True |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the dataview displays record details. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'datatable' | Registered component that renders the table body. |
view_type | Literal['table'] | 'table' | Select the table view. |
page_size | Literal[10, 25, 50, 100] | 25 | The number of records shown on each page. |
sort_field | str | None | None | The field used for table sorting. |
sort_direction | Literal['asc', 'desc'] | 'asc' | The direction used for table sorting. |
Kanban
ID kanban
Displays records in a kanban board.
| Field | Value |
|---|---|
icon | fa fa-columns |
requires_display_fields | True |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the dataview displays record details. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'kanban-board' | Registered component that renders the Kanban board. |
view_type | Literal['kanban'] | 'kanban' | Select the Kanban board. |
group_by_field | str | None | None | Field whose values determine which lane each card belongs to. |
custom_groupings | dict[str, list[str]] | {} | Map custom lane names to grouping values to combine in each lane. |
custom_group_order | list[str] | [] | Custom lane names in display order. |
show_unmapped_lanes | bool | True | Show individual lanes for values outside the custom groups. |
lane_colouring | dict[str, str] | {} | Map lane names or grouping values to six-digit hex colors. |
page_size | Literal[10, 25, 50, 100] | 25 | The number of cards initially shown in each lane. |
sort_field | str | None | None | Field used to sort cards in each lane. |
sort_direction | Literal['asc', 'desc'] | 'asc' | Choose ascending or descending order within each lane. |
Card
ID card
Displays records in a card grid.
| Field | Value |
|---|---|
icon | fa fa-id-card |
requires_display_fields | True |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the dataview displays record details. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'card-view' | Registered component that renders the card grid. |
view_type | Literal['card'] | 'card' | Select the card grid. |
page_size | Literal[10, 25, 50, 100] | 25 | The number of cards shown on each page. |
Calendar
ID calendar
Displays records in a calendar view.
| Field | Value |
|---|---|
icon | fa fa-calendar |
requires_display_fields | True |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'drawer' | Choose how the calendar opens the details of a selected event. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'calendar' | Registered component that renders the calendar body. |
view_type | Literal['calendar'] | 'calendar' | Select the calendar view. |
start_field | str | None | None | Date or date-time field that places the start of each event. |
end_field | str | None | None | Date or date-time field that sets the end of each event range. |
start_date_field | str | None | None | Start date for an all-day event. Configure this with end_date_field. |
end_date_field | str | None | None | Exclusive end date for an all-day event. Configure this with start_date_field. |
calendar_view_mode | Literal['day', 'week', 'month', 'year', 'list'] | 'week' | Calendar period or list layout to display by default. |
color_grouping_field | str | None | None | Field whose values determine event colors and the legend. |
Gantt
ID gantt
Displays records in a Gantt chart.
| Field | Value |
|---|---|
icon | fa fa-chart-gantt |
requires_display_fields | True |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list | [] | Field names to display beside each record on the timeline. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the dataview displays record details. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'gant-chart' | Registered component that renders the Gantt timeline. |
view_type | Literal['gantt'] | 'gantt' | Select the Gantt chart. |
start_field | str | Required | Field that sets the beginning of a timeline bar. |
end_field | str | Required | Field that sets the end of a timeline bar. |
dependency_from_field | str | None | None | Self-referencing relation for the record that precedes this one. |
dependency_for_field | str | None | None | Self-referencing relation for the record that follows this one. |
page_size | Literal[10, 25, 50, 100] | 25 | The number of timeline rows loaded at a time. |
ordering | str | None | None | Field used to order timeline rows. |
ordering_direction | Literal['asc', 'desc'] | 'asc' | Choose ascending or descending order for timeline rows. |
Pivot
ID pivot_table
Displays records in a pivot table.
| Field | Value |
|---|---|
icon | fa fa-table |
requires_display_fields | True |
record_based | False |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the dataview displays record details. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'pivot-table' | Registered component that renders the pivot table. |
view_type | Literal['pivot_table'] | 'pivot_table' | Select the pivot table. |
row_fields | list[str] | [] | Fields that define the expandable row hierarchy. |
column_fields | list[str] | [] | Fields that define the nested column headers. |
value_fields | list[str] | [] | Fields whose values are aggregated into the pivot cells. |
aggregation | Literal['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_totals | bool | True | Show totals at the end of each row. |
show_column_totals | bool | True | Show totals beneath the columns. |
totals_scope | Literal['page', 'dataset'] | 'page' | Calculate the totals row from the current page or the entire filtered dataset. |
page_size | Literal[10, 25, 50, 100] | 25 | The number of top-level pivot rows shown on each page. |
File Browser
ID file_browser
File browser
| Field | Value |
|---|---|
icon | fa fa-file |
requires_display_fields | False |
record_based | True |
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.
| Setting | Type | Default | Description |
|---|---|---|---|
name | str | 'Default' | Name of the dataview.Minimum length: 1Maximum length: 255 |
is_default | bool | True | Select this dataview as the model's default. |
display_fields | list[str] | [] | Field names to display, in display order. |
default_filters | dict[str, str | list[str]] | {} | Initial filter query parameters and values. |
view_mode | Literal['normal', 'split', 'drawer'] | 'normal' | Choose how the browser opens record details on selection. |
item_click_action_id | str | None | None | Registered Object Action ID to run on click. If unset, open record details.Minimum length: 1 |
component_args | dict[str, str] | {} | Arguments passed to the dataview component. |
container_component_id | str | 'dataview-container' | Registered component for the dataview container. |
dataview_component_id | str | None | 'file-browser' | Registered component that renders the file browser. |
view_type | Literal['file_browser'] | 'file_browser' | Select the file browser. |
related_fields | dict[int, list[str]] | {} | Map host model content type IDs to relation names whose attached files should be included. |
folder_type | Literal['virtual', 'physical'] | 'virtual' | Browse files by their linked records or by stored folders. |
