Skip to main content

Tables

A table class (ModelTable) controls what the user sees in the CRUD list view — which columns appear, how they're labelled, whether they're sortable or searchable, and what actions are available per row.

How It Fits Together

BaseCrudView
├── table = PatientTable ← controls the list
└── form = PatientForm ← controls add/edit

The table is rendered on the frontend by CrudHandler (see Frontend Integration).

What a Table Class Defines

FeatureHow
ColumnsModelCol or StringCol attributes
Computed column values<column>_getval(self, obj) method
Row actions (edit, delete, custom)row_actions list
Row action visibility per objectcan_perform_row_action_<key>(self, request, obj)
Row action logicprocess_row_action_<key>(self, request, obj)

Sections

SectionDescription
Creating a Table ClassImports, Meta, column definitions
Table ColumnsModelCol, StringCol, user_roles
Custom Display Methods_getval for computed columns
Row Action MethodsDefining and processing row actions
API ReferenceFull parameter reference