Files

20 lines
581 B
Python
Raw Permalink Normal View History

2024-07-03 21:41:03 +02:00
from django.contrib import admin
from quiz.models import Quiz, Question
from lib.mixins import PermissionsAdminMixin
2024-07-03 21:41:03 +02:00
class QuizQuestionInlineAdmin(admin.StackedInline):
model = Question
@admin.register(Quiz)
class QuizAdmin(PermissionsAdminMixin, admin.ModelAdmin):
2024-07-03 21:41:03 +02:00
inlines = (QuizQuestionInlineAdmin,)
list_display = ('name', 'download_urls')
search_fields = (
'name', 'question__question__name', 'question__question__question',
'question__question__awnser', 'question__question__level__value',
'question__question__label_name',
)