.
This commit is contained in:
+4
-6
@@ -9,7 +9,7 @@ from .models import (
|
|||||||
Finding,
|
Finding,
|
||||||
SeriesFinding,
|
SeriesFinding,
|
||||||
Structure,
|
Structure,
|
||||||
PathalogicalProcess,
|
PathologicalProcess,
|
||||||
Presentation,
|
Presentation,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,13 +35,14 @@ admin.site.register(Finding)
|
|||||||
admin.site.register(Structure)
|
admin.site.register(Structure)
|
||||||
admin.site.register(SeriesFinding)
|
admin.site.register(SeriesFinding)
|
||||||
admin.site.register(Differential)
|
admin.site.register(Differential)
|
||||||
admin.site.register(PathalogicalProcess)
|
admin.site.register(PathologicalProcess)
|
||||||
admin.site.register(Presentation)
|
admin.site.register(Presentation)
|
||||||
|
|
||||||
|
|
||||||
class DifferentialInline(admin.TabularInline):
|
class DifferentialInline(admin.TabularInline):
|
||||||
model = Differential
|
model = Differential
|
||||||
|
|
||||||
|
|
||||||
class AtlasAdminForm(ModelForm):
|
class AtlasAdminForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Case
|
model = Case
|
||||||
@@ -74,10 +75,7 @@ class AtlasAdmin(VersionAdmin):
|
|||||||
save_as = True
|
save_as = True
|
||||||
view_on_site = True
|
view_on_site = True
|
||||||
|
|
||||||
inlines = (
|
inlines = (DifferentialInline,)
|
||||||
DifferentialInline,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Case, AtlasAdmin)
|
admin.site.register(Case, AtlasAdmin)
|
||||||
|
|||||||
+19
-3
@@ -1,6 +1,15 @@
|
|||||||
import django_filters
|
import django_filters
|
||||||
|
|
||||||
from .models import Case, Condition, Finding, PathalogicalProcess, Presentation, Series, Structure, Subspecialty
|
from .models import (
|
||||||
|
Case,
|
||||||
|
Condition,
|
||||||
|
Finding,
|
||||||
|
PathologicalProcess,
|
||||||
|
Presentation,
|
||||||
|
Series,
|
||||||
|
Structure,
|
||||||
|
Subspecialty,
|
||||||
|
)
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +38,12 @@ class CaseFilter(django_filters.FilterSet):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Case
|
model = Case
|
||||||
fields = ("created_date", "open_access", "author", "differential_case") # "site",
|
fields = (
|
||||||
|
"created_date",
|
||||||
|
"open_access",
|
||||||
|
"author",
|
||||||
|
"differential_case",
|
||||||
|
) # "site",
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@@ -135,6 +149,7 @@ class StructureFilter(django_filters.FilterSet):
|
|||||||
)
|
)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class PresentationFilter(django_filters.FilterSet):
|
class PresentationFilter(django_filters.FilterSet):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Presentation
|
model = Presentation
|
||||||
@@ -157,7 +172,7 @@ class PresentationFilter(django_filters.FilterSet):
|
|||||||
|
|
||||||
class PathologicalProcessFilter(django_filters.FilterSet):
|
class PathologicalProcessFilter(django_filters.FilterSet):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PathalogicalProcess
|
model = PathologicalProcess
|
||||||
fields = ("name",)
|
fields = ("name",)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -174,6 +189,7 @@ class PathologicalProcessFilter(django_filters.FilterSet):
|
|||||||
)
|
)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SubspecialtyFilter(django_filters.FilterSet):
|
class SubspecialtyFilter(django_filters.FilterSet):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Subspecialty
|
model = Subspecialty
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.2.8 on 2021-12-07 15:23
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('atlas', '0020_rename_pathalogical_process_case_pathological_process'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameModel(
|
||||||
|
old_name='PathalogicalProcess',
|
||||||
|
new_name='PathologicalProcess',
|
||||||
|
),
|
||||||
|
]
|
||||||
+2
-2
@@ -163,7 +163,7 @@ class Subspecialty(models.Model):
|
|||||||
return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name)
|
return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name)
|
||||||
|
|
||||||
|
|
||||||
class PathalogicalProcess(models.Model):
|
class PathologicalProcess(models.Model):
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
@@ -230,7 +230,7 @@ class Case(models.Model):
|
|||||||
|
|
||||||
presentation = models.ManyToManyField(Presentation, blank=True)
|
presentation = models.ManyToManyField(Presentation, blank=True)
|
||||||
|
|
||||||
pathological_process = models.ManyToManyField(PathalogicalProcess, blank=True)
|
pathological_process = models.ManyToManyField(PathologicalProcess, blank=True)
|
||||||
|
|
||||||
differential = models.ManyToManyField(
|
differential = models.ManyToManyField(
|
||||||
Condition, through=Differential, related_name="casedifferential"
|
Condition, through=Differential, related_name="casedifferential"
|
||||||
|
|||||||
+3
-2
@@ -4,7 +4,7 @@ from django_tables2.utils import A
|
|||||||
from .models import (
|
from .models import (
|
||||||
Case,
|
Case,
|
||||||
Condition,
|
Condition,
|
||||||
PathalogicalProcess,
|
PathologicalProcess,
|
||||||
Presentation,
|
Presentation,
|
||||||
Series,
|
Series,
|
||||||
Structure,
|
Structure,
|
||||||
@@ -276,11 +276,12 @@ class PathologicalProcessTable(tables.Table):
|
|||||||
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PathalogicalProcess
|
model = PathologicalProcess
|
||||||
template_name = "django_tables2/bootstrap4.html"
|
template_name = "django_tables2/bootstrap4.html"
|
||||||
fields = ("name",)
|
fields = ("name",)
|
||||||
sequence = ("name",)
|
sequence = ("name",)
|
||||||
|
|
||||||
|
|
||||||
class SubspecialtyTable(tables.Table):
|
class SubspecialtyTable(tables.Table):
|
||||||
name = tables.Column(
|
name = tables.Column(
|
||||||
linkify=("atlas:subspecialty_detail", {"pk": tables.A("pk")}),
|
linkify=("atlas:subspecialty_detail", {"pk": tables.A("pk")}),
|
||||||
|
|||||||
+3
-3
@@ -40,7 +40,7 @@ from .forms import (
|
|||||||
from .models import (
|
from .models import (
|
||||||
Case,
|
Case,
|
||||||
Condition,
|
Condition,
|
||||||
PathalogicalProcess,
|
PathologicalProcess,
|
||||||
Presentation,
|
Presentation,
|
||||||
Series,
|
Series,
|
||||||
Examination,
|
Examination,
|
||||||
@@ -210,7 +210,7 @@ def presentation_detail(request, pk):
|
|||||||
@login_required
|
@login_required
|
||||||
@user_is_atlas_checker
|
@user_is_atlas_checker
|
||||||
def pathological_process_detail(request, pk):
|
def pathological_process_detail(request, pk):
|
||||||
pathological_process = get_object_or_404(PathalogicalProcess, pk=pk)
|
pathological_process = get_object_or_404(PathologicalProcess, pk=pk)
|
||||||
|
|
||||||
# logging.debug(atlas.subspecialty.first().name.all())
|
# logging.debug(atlas.subspecialty.first().name.all())
|
||||||
return render(
|
return render(
|
||||||
@@ -685,7 +685,7 @@ class PresentationView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
|||||||
|
|
||||||
|
|
||||||
class PathologicalProcessView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
class PathologicalProcessView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||||
model = PathalogicalProcess
|
model = PathologicalProcess
|
||||||
table_class = PathologicalProcessTable
|
table_class = PathologicalProcessTable
|
||||||
template_name = "atlas/view.html"
|
template_name = "atlas/view.html"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user