diff options
author | Matthew Lemon <y@yulqen.org> | 2024-04-23 11:16:38 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-04-23 11:16:38 +0100 |
commit | 0f951dcf029d4af284467543a3afdf5bf6581a20 (patch) | |
tree | a48384210cdc168e3bd3ccff6d6d516eeed9e748 /core/views.py | |
parent | 8b084e9fe7a5f3a04c32daf9a24f7f2cf67300f9 (diff) |
switched to Django
Diffstat (limited to 'core/views.py')
-rw-r--r-- | core/views.py | 24 |
1 files changed, 24 insertions, 0 deletions
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) |