Each template receives a context object serialized as a MiniJinja value. The variables available depend on which template is being rendered.
These variables are present in both list.html and form.html:
Variable Type Description
admin_titlestring The title set via .title("My Admin")
admin_iconstring Font Awesome class for the sidebar logo icon
entitiesarray Flat list of all registered entities (see EntityRef below)
navarray Sidebar navigation items (see below)
current_entitystring Name of the currently active entity
entity_namestring URL slug of the current entity
entity_labelstring Human-readable name of the current entity
flash_successstring or null Success flash message
flash_errorstring or null Error flash message
show_auth_navbool Whether to show Users / Roles links in the sidebar
The nav array contains items of two types, distinguished by a type field:
Entity link (type == "entity"):
Field Type Description
namestring Entity URL slug
labelstring Display label
iconstring Font Awesome class
groupstring or null Group name if grouped
Group (type == "group"):
Field Type Description
labelstring Group display label
entitiesarray Child entity links (same shape as entity type)
activebool True if any child is currently active
The entities array (available on all list and form pages) is a flat list of every registered entity, useful for building custom navigation or cross-entity links.
Field Type Description
namestring Entity URL slug
labelstring Display label
iconstring Font Awesome class
groupstring or null Group name if the entity belongs to a group
Variable Type Description
columnsarray of strings Column names to display
column_typesmap Maps column name to field type string
rowsarray Row data (see below)
searchstring Current search query
pageinteger Current page number
total_pagesinteger Total number of pages
order_bystring Column currently sorted
order_dirstring "asc" or "desc"
filter_fieldsarray Fields available as filters (see FieldContext below)
active_filtersmap Currently applied filter values, keyed by field name
actionsarray Bulk/row actions (see ActionContext below)
bulk_deletebool Whether bulk delete is enabled
bulk_exportbool Whether bulk CSV export is enabled
export_columnsarray of [name, label] pairs Columns available for export
can_createbool Whether the current user can create records
can_editbool Whether the current user can edit records
can_deletebool Whether the current user can delete records
Field Type Description
idstring Record primary key
datamap Column name → display value (all strings)
Field Type Description
namestring Action identifier used in the POST URL
labelstring Button label
targetstring "list" (bulk) or "row" (per-row)
confirmstring or null Confirmation message, if any
iconstring or null Font Awesome class for button icon
classstring or null Custom CSS classes for the button
Variable Type Description
fieldsarray Field definitions (see FieldContext below)
valuesmap Current field values, keyed by field name
errorsmap Validation error messages, keyed by field name
is_createbool True when creating a new record, false when editing
record_idstring The record's primary key (empty string on create)
csrf_tokenstring CSRF token to include in form submissions
can_savebool Whether the current user can save this record
Field Type Description
namestring Field name (used as <input name>)
labelstring Human-readable label
field_typestring One of: Text, Textarea, Integer, Float, Boolean, Select, Date, DateTime, File, ManyToMany, Hidden
readonlybool Field is read-only
hiddenbool Field is hidden entirely
list_onlybool Field only appears on list pages
form_onlybool Field only appears on form pages
requiredbool Field is required
help_textstring or null Optional help text shown below the field
optionsarray of [value, label] pairs Options for Select fields
selected_idsarray of strings Currently selected IDs for ManyToMany fields
acceptarray of strings Accepted MIME types for File fields
Variable Type Description
admin_titlestring Admin panel title
admin_iconstring Font Awesome class for the sidebar logo icon
navarray Sidebar navigation items (same shape as common nav)
current_entitystring Always an empty string on this page
csrf_tokenstring CSRF token to include in the form submission
errorstring or null Inline error message (e.g. wrong current password)
successstring or null Inline success message after a successful password change
flash_successstring or null Success flash message carried over from a redirect
flash_errorstring or null Error flash message carried over from a redirect
Variable Type Description
admin_titlestring Admin panel title
errorstring or null Login error message
csrf_tokenstring CSRF token
nextstring or null URL to redirect to after login
Variable Type Description
successstring or null Success message
errorstring or null Error message