From 0f951dcf029d4af284467543a3afdf5bf6581a20 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 23 Apr 2024 11:16:38 +0100 Subject: switched to Django --- core/views.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/views.py (limited to 'core/views.py') diff --git a/core/views.py b/core/views.py new file mode 100644 index 0000000..4e7cd41 --- /dev/null +++ b/core/views.py @@ -0,0 +1,24 @@ +from django.contrib.auth.decorators import login_required +from django.shortcuts import render + +from engagements.models import Engagement + + +@login_required +def index(request): + subs = Engagement.objects.sp().order_by("proposed_start_date")[:4] + subs_regulatory = Engagement.objects.sp_regulatory()[:4] + trans = Engagement.objects.tr()[:4] + context = dict(subs=subs, trans=trans, subs_regulatory=subs_regulatory) + return render(request, "core/index.html", context) + + +@login_required +def dashboard(request): + return render(request, "core/dashboard.html", {"section": "dashboard"}) + + +@login_required +def profile(request): + args = {"user": request.user} + return render(request, "core/profile.html", args) -- cgit v1.2.3