Edit models and create list view

This commit is contained in:
Jan Tuomi
2017-10-11 18:36:26 +03:00
parent df931fb3e5
commit bd45742953
7 changed files with 116 additions and 7 deletions
+15 -1
View File
@@ -8,7 +8,7 @@ from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth.decorators import permission_required, login_required
from django.conf import settings
import logging
from webapp.models import OhlhafvChallenge
from webapp.models import OhlhafvChallenge, KaehmyForm
from webapp.forms import OhlhafvForm
from webapp.tables import OhlhafvTable
@@ -146,3 +146,17 @@ def ohlhafv_list(request, *args, **kwargs):
'challenge_count': len(challenges),
}
return render(request, 'ohlhafv_list.html', context)
@ensure_csrf_cookie
@require_http_methods(["GET"])
def kaehmy_list_view(request, *args, **kwargs):
"""Kaehmy application list"""
applications = KaehmyForm.objects.all()
context = {
'applications': applications,
'application_count': len(applications)
}
return render(request, 'kaehmy_list.html', context)