diff options
Diffstat (limited to 'engagements/views.py')
-rw-r--r-- | engagements/views.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engagements/views.py b/engagements/views.py index ae1abfd..a76a37d 100644 --- a/engagements/views.py +++ b/engagements/views.py @@ -1,11 +1,13 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q -from django.shortcuts import get_object_or_404, redirect, render +from django.http import HttpResponse +from django.shortcuts import get_object_or_404 +from django.shortcuts import redirect, render +from django.template.loader import render_to_string from django.views.generic import ListView from instruments.models import SubInstrument - from .forms import ( EngagementCreateForm, EngagementEffortPlanningCreateForm, @@ -16,6 +18,12 @@ from .forms import ( from .models import Engagement, EngagementEffort, EngagementType, Organisation +def effort_detail(request, effort_id): + effort = get_object_or_404(EngagementEffort, id=effort_id) + html = render_to_string('engagements/snippets/effort_detail.html', {'effort': effort}) + return HttpResponse(html) + + class RegulatedEntitiesView(LoginRequiredMixin, ListView): context_object_name = "entities" queryset = Organisation.objects.filter(is_regulated_entity=True).order_by("name") |