This commit is contained in:
Ross
2022-04-02 22:34:14 +01:00
parent 8498b17678
commit 1646bac2cb
5 changed files with 87 additions and 8 deletions
+40
View File
@@ -313,3 +313,43 @@ class SubspecialtyTable(tables.Table):
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
return f"{record.get_synonym_link()}"
class CaseCollectionTable(tables.Table):
edit = tables.LinkColumn(
"atlas:collection_update", text="Edit", args=[A("pk")], orderable=False
)
view = tables.LinkColumn(
"atlas:collection_view", text="View", args=[A("pk")], orderable=False
)
#clone = tables.LinkColumn(
# "atlas:case_clone", text="Clone", args=[A("pk")], orderable=False
#)
delete = tables.LinkColumn(
"atlas:collection_delete", text="Delete", args=[A("pk")], orderable=False
)
#series = AtlasImageColumn("Images", orderable=False)
#differential = tables.ManyToManyColumn(verbose_name="Differential")
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
class Meta:
model = Case
template_name = "django_tables2/bootstrap4.html"
fields = (
"name",
"collection_type",
"publish_results",
"active",
"author",
)
sequence = ("view", )#, "series")
def __init__(self, data=None, *args, **kwargs):
super().__init__(
data.prefetch_related(
#"condition", "condition__synonym"
),
*args,
**kwargs,
)