1from typing import Any
2
3from .base import Card
4
5
6class TableCard(Card):
7 template_name = "admin/cards/table.html"
8 size = Card.Sizes.FULL
9
10 headers: tuple = ()
11 rows: tuple = ()
12 footers: tuple = ()
13
14 def get_template_context(self) -> dict[str, Any]:
15 context = super().get_template_context()
16 context["headers"] = self.get_headers()
17 context["rows"] = self.get_rows()
18 context["footers"] = self.get_footers()
19 return context
20
21 def get_headers(self) -> tuple:
22 return self.headers
23
24 def get_rows(self) -> tuple:
25 return self.rows
26
27 def get_footers(self) -> tuple:
28 return self.footers