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
| Feature | How |
|---|---|
| Columns | ModelCol or StringCol attributes |
| Computed column values | <column>_getval(self, obj) method |
| Row actions (edit, delete, custom) | row_actions list |
| Row action visibility per object | can_perform_row_action_<key>(self, request, obj) |
| Row action logic | process_row_action_<key>(self, request, obj) |
Sections
| Section | Description |
|---|---|
| Creating a Table Class | Imports, Meta, column definitions |
| Table Columns | ModelCol, StringCol, user_roles |
| Custom Display Methods | _getval for computed columns |
| Row Action Methods | Defining and processing row actions |
| API Reference | Full parameter reference |