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