.
This commit is contained in:
@@ -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,
|
||||
)
|
||||
Reference in New Issue
Block a user