Changelist
The changelist is the ModelAdmin list page. Chassis keeps Django's result table and bulk actions, then rebuilds the chrome around them: breadcrumbs, toolbar, tabs, search, date hierarchy, and filters all sit in Chassis fieldsets.
admin/chassis/change_list.html extends Django's admin/change_list.html
and defines the content structure shared by Django 6.0 and 6.1. Tabs,
search, date hierarchy, and filters render before the results form.
Bulk actions, the result table, and pagination render inside that form.
Every field below is documented in the Options catalog. This page explains how the page is assembled.
Page anatomy
The bulk action selector uses a responsive 25em width.
┌─ breadcrumbs ─────────────────────────────────────────────┐
│ Dashboard › Sidebar section › Model verbose name │
├─ toolbar (`page_actions` / `object-tools`) ───────────────┤
│ [list actions…] [Import] [Export] [+ Add] │
├─ controls stack (`chassis-changelist-controls`) ──────────┤
│ Tabs fieldset FieldTabs / ForeignKeyTabs │
│ Search fieldset SearchOption │
│ Dates fieldset DateHierarchyOption │
│ Filters fieldset FiltersOption │
├─ results fieldset ────────────────────────────────────────┤
│ Django bulk actions (top) │
│ Result table: list_display + last-column row actions │
│ Django bulk actions (bottom) │
│ Total count Items per page · Pages │
└───────────────────────────────────────────────────────────┘
| Region | Driven by | Notes |
|---|---|---|
| Breadcrumbs | AdminSidebarService | Section label only if the model is in sidebar_items |
| List actions | ListActionsOption | Named URLs; may render disabled |
| Import / Export | ImportOption / ExportOption | Injected as list actions |
| Add | has_add_permission + Settings.allow_standard_add | Hidden when either is false |
| Choice tabs | FieldTabsOption | One row of buttons or a select |
| FK tabs | ForeignKeyTabsOption | One group per ForeignKeyTabGroupOption |
| Search | SearchOption | Collapsed via Settings.search_collapsed |
| Dates | DateHierarchyOption | Collapsed via Settings.date_hierarchy_collapsed |
| Filters | FiltersOption | Collapsed via Settings.filters_collapsed |
| Table columns | Django list_display | Badge / decimal / JSON fields are rewritten |
| Last column | RowActionsOption | Open and delete according to permissions. Quick view is optional. |
Open a record from its row actions. Chassis renders data cells without Django’s automatic change links. Boolean cells show a green check for true and a red cross for false.
How options are applied
On ChassisAdminMixin.__init__:
SearchOption.fieldsis written to instancesearch_fields.DateHierarchyOption.fieldis written to instancedate_hierarchy.- Badge, pretty-JSON, and decimal display methods are generated.
- List-action
condition_methodnames are validated as@classmethod.
On changelist_view:
- Tabs and FK tab groups become context (
tabs,tab_groups,field_tab_display). - Search / filters / date hierarchy titles and collapsed flags go into context.
_get_chassis_list_actionsmergesListActionsOptionwith import/export buttons.
Query-string parameters of tabs, search, and filters are preserved when you follow Add or a row action.
Search
from django_chassis.options import SearchOption
SearchOption(fields=['title', 'isbn'], fieldset_title='Search', placeholder='Title or ISBN')
| Parameter | Type | Default |
|---|---|---|
fields | list[str] | required — becomes search_fields |
fieldset_title | localized string | Search / Поиск |
placeholder | localized string | '' |
Lookups are Django's: default icontains, ^ prefix, = exact, @
full text.
Filters
from django_chassis.options import FiltersOption
FiltersOption(fields=['status', 'author'], fieldset_title='Filters')
fields accepts the same values as Django list_filter (field names,
related lookups, SimpleListFilter subclasses). The stock right-hand
filter sidebar is not used.
Date hierarchy
from django_chassis.options import DateHierarchyOption
DateHierarchyOption(field='published_at')
| Parameter | Type | Default |
|---|---|---|
field | model date/datetime field | required |
fieldset_title | localized string | Dates / Даты |
Field tabs
Choice-based tabs (or a select) that filter the changelist.
For a standalone tab bar above page content, add chassis-field-tabs--page alongside chassis-field-tabs to leave a 1rem gap below it.
from django_chassis.enums import TabDisplay
from django_chassis.options import FieldTabsOption
FieldTabsOption(field='status', choices=Book.Status.choices, display=TabDisplay.BUTTONS, all_label='All')
| Parameter | Type | Default |
|---|---|---|
field | model field name | required |
choices | list of (value, label) | required |
display | TabDisplay.BUTTONS or SELECT | BUTTONS |
all_label | localized string | All / Все |
fieldset_title | localized string | Tabs |
Each tab is a GET link. "All" drops the query parameter.
Foreign-key tabs
Changed in 1.0.9One or more FK-based tab groups. Attach one ForeignKeyTabsOption
and put every group in groups.
from django_chassis.options import ForeignKeyTabGroupOption, ForeignKeyTabsOption
ForeignKeyTabsOption(groups=[ForeignKeyTabGroupOption(field='author', model=Author, label='Authors')])
ForeignKeyTabsOption also accepts a single-group shortcut via field
and model instead of groups. Both forms accept queryset_filters, which
is passed to the related model manager and limits the objects shown as tabs.
Full field tables:
Options catalog.
Collapsed fieldsets
Settings.search_collapsed, filters_collapsed, and
date_hierarchy_collapsed control the initial state. See
ModelAdmin and Options catalog.
See also
Preferred page size
Changed in 1.0.23The footer places the total result count on the left. On the right, Items
per page comes before Django’s page links, with a gap between page buttons. Choose 25, 50, 75 or 100 to
apply the size immediately. Chassis stores the
choice in the current user's profile and returns to the first page with the
current search and filters. Set CHASSIS_LIST_PAGE_SIZES to change the options
and CHASSIS_LIST_PAGE_SIZE for the site default, which otherwise comes from the first option. Before the user makes a choice, a ModelAdmin's custom list_per_page takes precedence. An empty options list hides the selector and restores Django's page size. Related tables use their own component page_size.