.
This commit is contained in:
+13
-1
@@ -758,4 +758,16 @@ class GenericViewBase:
|
||||
def author_list(self, request):
|
||||
authors = User.objects.all()
|
||||
|
||||
return render(request, f"{self.app_name}/author_list.html", {"authors": authors})
|
||||
return render(request, f"{self.app_name}/author_list.html", {"authors": authors})
|
||||
|
||||
|
||||
class ExamCloneMixin():
|
||||
def get_initial(self):
|
||||
old_object = get_object_or_404(self.model, pk=self.kwargs["exam_id"])
|
||||
initial_data = model_to_dict(old_object, exclude=["id"])
|
||||
|
||||
questions = old_object.exam_questions.all().values_list("id", flat=True)
|
||||
|
||||
initial_data["exam_questions"] = list(questions)
|
||||
|
||||
return initial_data
|
||||
Reference in New Issue
Block a user