14 lines
398 B
Python
14 lines
398 B
Python
from django.views.generic import TemplateView
|
|
|
|
from core.models import Subject
|
|
from core.prediction import predict_all
|
|
|
|
|
|
class SubjectsView(TemplateView):
|
|
template_name = "core/subjects.html"
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
context["prediction_list"] = predict_all(Subject.objects.order_by("name"))
|
|
return context
|