From 399236e98ef1a662a9bea178739d299c57499dd0 Mon Sep 17 00:00:00 2001 From: cja Date: Tue, 3 Jun 2025 15:59:28 +0300 Subject: [PATCH] P-259: admin testing result --- src/back/tests/admin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/back/tests/admin.py b/src/back/tests/admin.py index 8c252d1fd..dc0563d7c 100644 --- a/src/back/tests/admin.py +++ b/src/back/tests/admin.py @@ -14,10 +14,19 @@ class TestQuestionInline(nested_admin.NestedStackedInline): class TestAdmin(nested_admin.NestedModelAdmin): inlines = [TestQuestionInline] +class TestAttemptInline(admin.TabularInline): + model = TestAttempt + extra = 0 # не показывать пустые формы + fields = ('score', 'attempt_number', 'completion_date') + readonly_fields = ('score', 'attempt_number', 'completion_date') + can_delete = False + @admin.register(Testing) class TestingAdmin(admin.ModelAdmin): # list_display = ('testing_user', 'testing_test', 'score', 'completion_date') list_display = ('get_user_fio', 'test', 'get_score', 'test_passed', 'completion_date') + fields = ('user','test', 'test_passed', 'completion_date') + inlines = [TestAttemptInline] def get_user_fio(self, obj): return obj.user.user.fio