This commit is contained in:
Aaron Kable
2026-01-08 08:50:54 +08:00
parent d4e3addd6c
commit 1c7c775029
2 changed files with 72 additions and 49 deletions

View File

@@ -130,22 +130,17 @@ from allianceauth.eveonline.models import EveCharacter
## Datatables server side view
class EveCharacterTable(DataTablesView):
model = EveCharacter
# Columns are rendered from these templates
# Templates can be a html file or template language directly in the list below
templates = [
"appname/stubs/icon.html",
"appname/stubs/name.html",
"appname/stubs/corp.html",
"{{ row.alliance_name }} {{ row.alliance_id }}"
]
# Define the columns for filtering and ordering
# Define the columns as a tuple.
# String for field name for filtering and ordering
# String for the render template
# Templates can be a html file or template language directly in the list below
columns = [
# (can_sort: bool, "field_for_queries_or_sort")
(False, ""),
(True, "character_name"),
(True, "corporation_name"),
(True, "alliance_name"),
# ("field_for_queries_or_sort", template: str)
("", "appname/stubs/icon.html"),
("character_name", "appname/stubs/name.html"),
("corporation_name", "appname/stubs/corp.html"),
("alliance_name", "{{ row.alliance_name }} {{ row.alliance_id }}"),
]
# if you need to do some prefetch or pre-filtering you can overide this function