.
This commit is contained in:
+15
-7
@@ -1,7 +1,15 @@
|
|||||||
import django_tables2 as tables
|
import django_tables2 as tables
|
||||||
from django_tables2.utils import A
|
from django_tables2.utils import A
|
||||||
|
|
||||||
from .models import Case, Condition, PathalogicalProcess, Presentation, Series, Structure, Finding
|
from .models import (
|
||||||
|
Case,
|
||||||
|
Condition,
|
||||||
|
PathalogicalProcess,
|
||||||
|
Presentation,
|
||||||
|
Series,
|
||||||
|
Structure,
|
||||||
|
Finding,
|
||||||
|
)
|
||||||
|
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
|
|
||||||
@@ -161,7 +169,7 @@ class ConditionTable(tables.Table):
|
|||||||
)
|
)
|
||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
#synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
# synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
||||||
synonym = tables.Column(empty_values=())
|
synonym = tables.Column(empty_values=())
|
||||||
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
||||||
|
|
||||||
@@ -188,7 +196,7 @@ class FindingTable(tables.Table):
|
|||||||
)
|
)
|
||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
#synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
# synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
||||||
synonym = tables.Column(empty_values=())
|
synonym = tables.Column(empty_values=())
|
||||||
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
||||||
|
|
||||||
@@ -201,6 +209,7 @@ class FindingTable(tables.Table):
|
|||||||
def render_synonym(self, value, record):
|
def render_synonym(self, value, record):
|
||||||
return format_html(record.get_synonym_link())
|
return format_html(record.get_synonym_link())
|
||||||
|
|
||||||
|
|
||||||
class StructureTable(tables.Table):
|
class StructureTable(tables.Table):
|
||||||
name = tables.Column(
|
name = tables.Column(
|
||||||
linkify=("atlas:structure_detail", {"pk": tables.A("pk")}),
|
linkify=("atlas:structure_detail", {"pk": tables.A("pk")}),
|
||||||
@@ -214,7 +223,7 @@ class StructureTable(tables.Table):
|
|||||||
)
|
)
|
||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
#synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
# synonym = tables.ManyToManyColumn(verbose_name="Synonyms")
|
||||||
synonym = tables.Column(empty_values=())
|
synonym = tables.Column(empty_values=())
|
||||||
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
parent = tables.ManyToManyColumn(verbose_name="Parents")
|
||||||
|
|
||||||
@@ -227,6 +236,7 @@ class StructureTable(tables.Table):
|
|||||||
def render_synonym(self, value, record):
|
def render_synonym(self, value, record):
|
||||||
return format_html(record.get_synonym_link())
|
return format_html(record.get_synonym_link())
|
||||||
|
|
||||||
|
|
||||||
class PresentationTable(tables.Table):
|
class PresentationTable(tables.Table):
|
||||||
name = tables.Column(
|
name = tables.Column(
|
||||||
linkify=("atlas:condition_detail", {"pk": tables.A("pk")}),
|
linkify=("atlas:condition_detail", {"pk": tables.A("pk")}),
|
||||||
@@ -264,10 +274,8 @@ class PathologicalProcessTable(tables.Table):
|
|||||||
)
|
)
|
||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
subspecialty = tables.ManyToManyColumn(verbose_name="Parents")
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PathalogicalProcess
|
model = PathalogicalProcess
|
||||||
template_name = "django_tables2/bootstrap4.html"
|
template_name = "django_tables2/bootstrap4.html"
|
||||||
fields = ()
|
fields = ()
|
||||||
sequence = ("name",)
|
sequence = ("name",)
|
||||||
|
|||||||
Reference in New Issue
Block a user