Information pages
AdminInformationPage is an AdminPage that renders structured sections,
alerts, badges, header actions, and timelines. You still pick one
access contract by subclassing PermissionAdminPage, PersonalAdminPage,
or SuperuserAdminPage and AdminInformationPage (MRO: access
contract first if both define has_view_permission).
Template: admin/chassis/information_page.html (extends
admin/chassis/page.html).
Page anatomy
┌─ breadcrumbs ─────────────────────────────────────────────┐
│ Dashboard › Section › page label │
├─ header actions (`chassis_page_actions`) ─────────────────┤
│ AdminPageActionDTO buttons │
├─ alerts ──────────────────────────────────────────────────┤
│ AdminPageAlertDTO strip │
├─ CSS grid of sections (four columns) ─────────────────────┤
│ ┌ section title [header_action] ─────────────────────┐ │
│ │ row: icon label value badges [row action] │ │
│ │ … or a timeline instead of rows │ │
│ └────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────┘
view() always calls:
self.render(
request=request,
information_sections=self.get_information_sections(request=request),
chassis_page_actions=self.get_page_actions(request=request),
chassis_page_alerts=self.get_page_alerts(request=request),
)
You implement get_information_sections. The other two hooks default to
[].
Hooks
| Method | Return | Required |
|---|---|---|
get_information_sections(request) | list[AdminInformationSectionDTO] | yes |
get_page_actions(request) | list[AdminPageActionDTO] | no |
get_page_alerts(request) | list[AdminPageAlertDTO] | no |
DTOs
AdminInformationSectionDTO
A titled block on the four-column grid.
| Field | Type | Default | Purpose |
|---|---|---|---|
title | localized string | required | Section heading |
rows | list[AdminInformationRowDTO] | required | Label/value rows |
column_span | int | 4 | Width in columns (1–4) |
column_start | int or None | None | Optional grid start |
row_span | int | 1 | Vertical span |
timeline | AdminTimelineDTO or None | None | Replaces rows when set |
header_action | AdminPageActionDTO or None | None | Button on the section header |
AdminInformationRowDTO
| Field | Type | Default |
|---|---|---|
label | localized string | required |
value | any or None | required |
action | AdminPageActionDTO or None | None |
badges | tuple[AdminInformationBadgeDTO, ...] | () |
icon_class | Font Awesome class | '' |
icon_color | ButtonColor or None | None |
icon_label | localized string | '' |
AdminInformationBadgeDTO
| Field | Type |
|---|---|
label | localized string |
color | ButtonColor |
AdminPageAlertDTO
| Field | Type | Default |
|---|---|---|
message | localized string | required |
color | ButtonColor | required |
icon_class | Font Awesome class | '' |
AdminPageActionDTO
Used in the page toolbar, section headers, and rows.
| Field | Type | Default |
|---|---|---|
label | localized string | required |
url | str | required |
color | ButtonColor | required |
icon_class | Font Awesome class | '' |
show_label | bool | False |
Timeline family
| DTO | Fields |
|---|---|
AdminTimelineDTO | groups: list[AdminTimelineGroupDTO], empty_text |
AdminTimelineGroupDTO | date_label, items: list[AdminTimelineItemDTO] |
AdminTimelineItemDTO | occurred_at: datetime, title, subtitle, result_color: ButtonColor | None |
Typical page
from django_chassis.dto import (
AdminInformationBadgeDTO,
AdminInformationRowDTO,
AdminInformationSectionDTO,
AdminPageActionDTO,
AdminPageAlertDTO,
)
from django_chassis.enums import ButtonColor
from django_chassis.views import AdminInformationPage, PermissionAdminPage
class InventoryPage(PermissionAdminPage, AdminInformationPage):
slug = 'inventory'
title = 'Inventory'
label = 'Inventory'
permission = view_inventory
def get_page_alerts(self, request):
return [
AdminPageAlertDTO(
message='Two imports are waiting for review.',
color=ButtonColor.WARNING,
icon_class='fa-solid fa-triangle-exclamation',
)
]
def get_page_actions(self, request):
return [
AdminPageActionDTO(
label='Open books',
url='/admin/catalog/book/',
color=ButtonColor.PRIMARY,
icon_class='fa-solid fa-book',
show_label=True,
)
]
def get_information_sections(self, request):
return [
AdminInformationSectionDTO(
title='Overview',
column_span=2,
rows=[
AdminInformationRowDTO(
label='Books',
value='128',
badges=(AdminInformationBadgeDTO(label='live', color=ButtonColor.SUCCESS),),
),
AdminInformationRowDTO(label='Authors', value='34'),
],
)
]
TableOption can sit next to sections when you need a tabular block on a
custom view(). Related-entity tables on a ModelAdmin change form are a
different option — see Related entities.