Coverage for polls/admin.py: 100.00%
12 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-23 10:02 -0700
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-23 10:02 -0700
1from django.contrib import admin 1a
3from .models import Choice, Question 1a
6class ChoiceInline(admin.TabularInline): 1a
7 model = Choice 1a
8 extra = 5 1a
11@admin.register(Question) 1a
12class QuestionAdmin(admin.ModelAdmin): 1a
13 fieldsets = [ 1a
14 (None, {"fields": ["question_text"]}),
15 (
16 "Date information",
17 {"fields": ["pub_date"], "classes": ["collapse"]},
18 ),
19 ]
20 inlines = [ChoiceInline] 1a
21 list_display = ("question_text", "pub_date", "was_published_recently") 1a
22 list_filter = ["pub_date"] 1a
23 search_fields = ["question_text"] 1a