.
This commit is contained in:
+20
-1
@@ -1,6 +1,6 @@
|
|||||||
import django_filters
|
import django_filters
|
||||||
|
|
||||||
from .models import Case, Condition, Finding, PathalogicalProcess, Presentation, Series, Structure
|
from .models import Case, Condition, Finding, PathalogicalProcess, Presentation, Series, Structure, Subspecialty
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
@@ -173,3 +173,22 @@ class PathologicalProcessFilter(django_filters.FilterSet):
|
|||||||
data=data, queryset=queryset, prefix=prefix, request=request
|
data=data, queryset=queryset, prefix=prefix, request=request
|
||||||
)
|
)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class SubspecialtyFilter(django_filters.FilterSet):
|
||||||
|
class Meta:
|
||||||
|
model = Subspecialty
|
||||||
|
fields = ("name")
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
data=None,
|
||||||
|
queryset=None,
|
||||||
|
prefix=None,
|
||||||
|
strict=None,
|
||||||
|
user=None,
|
||||||
|
request=None,
|
||||||
|
):
|
||||||
|
super(SubspecialtyFilter, self).__init__(
|
||||||
|
data=data, queryset=queryset, prefix=prefix, request=request
|
||||||
|
)
|
||||||
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from .models import (
|
|||||||
Series,
|
Series,
|
||||||
Structure,
|
Structure,
|
||||||
Finding,
|
Finding,
|
||||||
|
Subspecialty,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
@@ -279,3 +280,27 @@ class PathologicalProcessTable(tables.Table):
|
|||||||
template_name = "django_tables2/bootstrap4.html"
|
template_name = "django_tables2/bootstrap4.html"
|
||||||
fields = ("name",)
|
fields = ("name",)
|
||||||
sequence = ("name",)
|
sequence = ("name",)
|
||||||
|
|
||||||
|
class SubspecialtyTable(tables.Table):
|
||||||
|
name = tables.Column(
|
||||||
|
linkify=("atlas:subspecialty_detail", {"pk": tables.A("pk")}),
|
||||||
|
verbose_name="Subspecialty",
|
||||||
|
)
|
||||||
|
|
||||||
|
#edit = tables.LinkColumn(
|
||||||
|
# "atlas:subspecialty_update", text="Edit", args=[A("pk")], orderable=False
|
||||||
|
#)
|
||||||
|
#delete = tables.LinkColumn(
|
||||||
|
# "atlas:subspecialty_delete", text="Delete", args=[A("pk")], orderable=False
|
||||||
|
#)
|
||||||
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Subspecialty
|
||||||
|
template_name = "django_tables2/bootstrap4.html"
|
||||||
|
fields = ("primary", "subspecialty")
|
||||||
|
sequence = ("name",)
|
||||||
|
|
||||||
|
def render_synonym(self, value, record):
|
||||||
|
return format_html(record.get_synonym_link())
|
||||||
|
return f"{record.get_synonym_link()}"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ urlpatterns = [
|
|||||||
path("author/", views.author_list, name="author_list"),
|
path("author/", views.author_list, name="author_list"),
|
||||||
path("case/", views.CaseView.as_view(), name="case_view"),
|
path("case/", views.CaseView.as_view(), name="case_view"),
|
||||||
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
||||||
|
path("subspecialty/", views.SubspecialtyView.as_view(), name="subspecialty_view"),
|
||||||
path("categories/", views.categories_list, name="categories_list"),
|
path("categories/", views.categories_list, name="categories_list"),
|
||||||
path("condition/<int:pk>", views.condition_detail, name="condition_detail"),
|
path("condition/<int:pk>", views.condition_detail, name="condition_detail"),
|
||||||
path(
|
path(
|
||||||
|
|||||||
+9
-1
@@ -50,7 +50,7 @@ from .models import (
|
|||||||
SeriesFinding,
|
SeriesFinding,
|
||||||
SeriesImage,
|
SeriesImage,
|
||||||
)
|
)
|
||||||
from .tables import CaseTable, ConditionTable, FindingTable, PathologicalProcessTable, PresentationTable, SeriesTable, StructureTable
|
from .tables import CaseTable, ConditionTable, FindingTable, PathologicalProcessTable, PresentationTable, SeriesTable, StructureTable, SubspecialtyTable
|
||||||
from .filters import (
|
from .filters import (
|
||||||
CaseFilter,
|
CaseFilter,
|
||||||
ConditionFilter,
|
ConditionFilter,
|
||||||
@@ -59,6 +59,7 @@ from .filters import (
|
|||||||
PresentationFilter,
|
PresentationFilter,
|
||||||
SeriesFilter,
|
SeriesFilter,
|
||||||
StructureFilter,
|
StructureFilter,
|
||||||
|
SubspecialtyFilter,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django_tables2 import SingleTableView, SingleTableMixin
|
from django_tables2 import SingleTableView, SingleTableMixin
|
||||||
@@ -639,6 +640,13 @@ class ConditionView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
|||||||
|
|
||||||
filterset_class = ConditionFilter
|
filterset_class = ConditionFilter
|
||||||
|
|
||||||
|
class SubspecialtyView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||||
|
model = Subspecialty
|
||||||
|
table_class = SubspecialtyTable
|
||||||
|
template_name = "atlas/view.html"
|
||||||
|
|
||||||
|
filterset_class = SubspecialtyFilter
|
||||||
|
|
||||||
class PresentationView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
class PresentationView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||||
model = Presentation
|
model = Presentation
|
||||||
table_class = PresentationTable
|
table_class = PresentationTable
|
||||||
|
|||||||
Reference in New Issue
Block a user