This commit is contained in:
Ross
2021-11-28 16:55:13 +00:00
parent 447e6acab8
commit a03c452d7c
3 changed files with 41 additions and 1 deletions
+29 -1
View File
@@ -30,11 +30,16 @@ from .forms import (
SeriesImageFormSet,
SeriesFormSet,
ExaminationForm,
SeriesFindingsForm
)
from .models import (
Case,
Series,
Examination,
Finding,
Subspecialty,
SeriesFindings,
SeriesImage
)
from .tables import AtlasTable, SeriesTable
from .filters import AtlasFilter, SeriesFilter
@@ -112,9 +117,11 @@ def series_detail(request, pk):
# if request.user not in atlas.author.all():
# raise PermissionDenied
series_finding_form = SeriesFindingsForm()
# logging.debug(atlas.subspecialty.first().name.all())
return render(request, "atlas/series.html", {"series": series})
return render(request, "atlas/series.html", {"series": series, "series_finding_form": series_finding_form})
@login_required
@@ -508,3 +515,24 @@ class SeriesImagesZipView(SuperuserRequiredMixin, BaseZipView):
series = Series.objects.get(pk=self.kwargs["pk"])
return [i.image.file for i in series.images.all()]
def create_series_findings(request):
#posts = Post.objects.all()
response_data = {}
if request.POST.get('action') == 'post':
series = request.POST.get('series')
findings = request.POST.get('findings')
description = request.POST.get('description')
annotation_json = request.POST.get('annotation_json')
sf = SeriesFindings.create(
series = series,
findings = findings,
description = description,
annotation_json = annotation_json,
)
return JsonResponse({"success":True})
return JsonResponse({"success": False})
return render(request, 'create_post.html', {'posts':posts})