From 887a615cfb6441ee0c2cfd5e14d4d7bbe27b3d64 Mon Sep 17 00:00:00 2001 From: kaushik Date: Wed, 24 Feb 2021 13:29:38 +0530 Subject: [PATCH] TWO MODULES ADDED FOR BOOKS --- .../classroom/templates/classroom/Books/icse.html | 12 ++++++++++++ .../classroom/templates/classroom/Books/ncert.html | 12 ++++++++++++ django_school/classroom/views/teachers.py | 4 +++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 django_school/classroom/templates/classroom/Books/icse.html create mode 100644 django_school/classroom/templates/classroom/Books/ncert.html diff --git a/django_school/classroom/templates/classroom/Books/icse.html b/django_school/classroom/templates/classroom/Books/icse.html new file mode 100644 index 00000000..75591b22 --- /dev/null +++ b/django_school/classroom/templates/classroom/Books/icse.html @@ -0,0 +1,12 @@ + + + + + + + ICSE Books + + + + + \ No newline at end of file diff --git a/django_school/classroom/templates/classroom/Books/ncert.html b/django_school/classroom/templates/classroom/Books/ncert.html new file mode 100644 index 00000000..11fed765 --- /dev/null +++ b/django_school/classroom/templates/classroom/Books/ncert.html @@ -0,0 +1,12 @@ + + + + + + + NCERT Books + + + + + \ No newline at end of file diff --git a/django_school/classroom/views/teachers.py b/django_school/classroom/views/teachers.py index 9237f2f5..45234f76 100644 --- a/django_school/classroom/views/teachers.py +++ b/django_school/classroom/views/teachers.py @@ -13,6 +13,7 @@ from ..decorators import teacher_required from ..forms import BaseAnswerInlineFormSet, QuestionForm, TeacherSignUpForm from ..models import Answer, Question, Quiz, User +from ..models import Question class TeacherSignUpView(CreateView): @@ -206,7 +207,8 @@ def delete(self, request, *args, **kwargs): return super().delete(request, *args, **kwargs) def get_queryset(self): - return Question.objects.filter(quiz__owner=self.request.user) + teacher=Question.objects.filter(quiz__owner=self.request.user) + return def get_success_url(self): question = self.get_object()