table_model
make_hierarchical_test_fetch(data)
Create a fetch_page callback from hierarchical test data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | dict[str | None, list[dict[str, Any]]] | Mapping of parent_id -> list[row_dict]. | required |
Returns:
| Type | Description |
|---|---|
Callable[[int, int, str | None, bool, str | None], list[dict[str, Any]]] | A callable suitable for PaginatedTableModel in tree mode. |
Source code in ui_preview/table_model.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
make_test_fetch(data)
Create a flat fetch_page callback from static data.
parent_id is accepted but ignored — all data lives at root level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | list[dict[str, Any]] | The full dataset to paginate. | required |
Returns:
| Type | Description |
|---|---|
Callable[[int, int, str | None, bool, str | None], list[dict[str, Any]]] | A callable suitable for PaginatedTableModel. |
Source code in ui_preview/table_model.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |