try adding series data to case table

This commit is contained in:
Ross
2025-04-25 18:28:40 +01:00
parent f584ea07a3
commit 405b17776f
3 changed files with 28 additions and 8 deletions
+13 -8
View File
@@ -27,6 +27,19 @@ from easy_thumbnails.exceptions import InvalidImageFormatError
class CaseTable(tables.Table):
def __init__(self, data=None, *args, **kwargs):
super().__init__(
data.prefetch_related(
"author", # Many-to-many or reverse relationship
"series", # Many-to-many relationship
"series__examination", # ForeignKey in the related model
"series__plane", # ForeignKey in the related model
"series__images", # Reverse relationship
),
*args,
**kwargs,
)
def get_view_cell(record):
if record.open_access:
return format_html(f"""<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-opencollective" viewBox="0 0 16 16">
@@ -68,14 +81,6 @@ class CaseTable(tables.Table):
sequence = ("view", )#, "series")
order_by = "-created_date"
def __init__(self, data=None, *args, **kwargs):
super().__init__(
data.prefetch_related(
"author", "series",#"condition", "condition__synonym"
),
*args,
**kwargs,
)
class PopupLinkColumn(tables.Column):
def render(self, value):