P-20
This commit is contained in:
1 parent
05763b620d
commit
5b526a3b5c
1 file changed
+17
-3
+17
-3
@@ -1,6 +1,20 @@
|
||||
from django.contrib import admin
|
||||
from .models import *
|
||||
|
||||
admin.site.register(Test)
|
||||
admin.site.register(TestQuestion)
|
||||
admin.site.register(TestAnswer)
|
||||
class TestAnswerInline(admin.StackedInline):
|
||||
model = TestAnswer
|
||||
extra = 0
|
||||
|
||||
class TestQuestionAdmin(admin.ModelAdmin):
|
||||
inlines = [TestAnswerInline]
|
||||
|
||||
class TestQuestionInline(admin.StackedInline):
|
||||
model = TestQuestion
|
||||
extra = 0
|
||||
|
||||
class TestAdmin(admin.ModelAdmin):
|
||||
inlines = [TestQuestionInline]
|
||||
|
||||
|
||||
admin.site.register(Test, TestAdmin)
|
||||
admin.site.register(TestQuestion, TestQuestionAdmin)
|
||||
Reference in new issue
Block a user