849f9185318693f9c40bf60fac9b87a6aefe769b
[koed-quiz.git] / apps / quiz / admin.py
1 from django.contrib import admin
2
3 from quiz.models import Question, Result, Answer
4
5
6 class AnswerInline(admin.TabularInline):
7     model = Answer
8     fk_name = 'question'
9     extra = 2
10
11
12 class QuestionAdmin(admin.ModelAdmin):
13     inlines = [AnswerInline]
14     list_display = ['title', 'quiz']
15
16
17 admin.site.register(Question, QuestionAdmin)
18 admin.site.register(Result)