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 django.contrib import admin
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
admin.site.register(Test)
|
class TestAnswerInline(admin.StackedInline):
|
||||||
admin.site.register(TestQuestion)
|
model = TestAnswer
|
||||||
admin.site.register(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