feat [P-287]: возможность для добавления файлов к тестам бэк
This commit is contained in:
1 parent
580c953e7b
commit
b8ccccc657
7 files changed
+129
-5
No files matched your search
@@ -1,5 +1,5 @@
|
||||
from django.contrib import admin
|
||||
from .models import Test, TestAnswer, TestQuestion, TestAttempt, DictEmployee, Testing
|
||||
from .models import Test, TestAnswer, TestQuestion, TestAttempt, DictEmployee, Testing, TestFile
|
||||
import nested_admin
|
||||
|
||||
class TestAnswerInline(nested_admin.NestedStackedInline):
|
||||
@@ -13,8 +13,13 @@ class TestQuestionInline(nested_admin.NestedStackedInline):
|
||||
inlines = [TestAnswerInline]
|
||||
fields = ('name', 'file')
|
||||
|
||||
class TestFileInline(nested_admin.NestedStackedInline):
|
||||
model = TestFile
|
||||
extra = 0
|
||||
|
||||
fields = ('file',)
|
||||
class TestAdmin(nested_admin.NestedModelAdmin):
|
||||
inlines = [TestQuestionInline]
|
||||
inlines = [TestFileInline, TestQuestionInline]
|
||||
|
||||
class TestAttemptInline(admin.TabularInline):
|
||||
model = TestAttempt
|
||||
|
||||
Reference in new issue
Block a user