diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-21 14:31:41 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-21 14:31:41 +0100 |
commit | 6d2cd94729a20904d5970b895e686af40353868e (patch) | |
tree | 6af2b26fc11f5a26ee6bd4019fda282e02e15e51 /ctrack/caf/views.py | |
parent | 22bfb9da5bd6da1e7de4bf5545144fab97f93f8d (diff) |
adding the form for caf single date event
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/views.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index a5d9953..e8479ab 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,3 +1,5 @@ +import itertools + from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.http import HttpResponseRedirect @@ -24,6 +26,8 @@ def caf_detail_view(request, pk): assessments = caf.cafassessment_set.all() # caf_principles = CAFPrinciple.objects.all() _scrs = [] + _events = list(itertools.chain(caf.cafsingledateevent_set.all(), caf.caftwindateevent_set.all())) + all_events = sorted(_events, key=lambda x: x.date, reverse=True) for ass in assessments: lst_scores = [ass, CAFAssessmentOutcomeScore.objects.filter(caf_assessment=ass)] _scrs.append(lst_scores) @@ -34,6 +38,7 @@ def caf_detail_view(request, pk): "systems": caf.systems.all(), "single_date_events": caf.cafsingledateevent_set.all(), "twin_date_events": caf.caftwindateevent_set.all(), + "all_events": all_events, } return render(request, "caf/caf_detail.html", context) |