from django.contrib import admin

from models import Poll, Choice


class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 1


class PollAdmin(admin.ModelAdmin):
    inlines = (ChoiceInline,)

admin.site.register(Poll, PollAdmin)

from django.contrib import admin

from models import Poll, Choice


class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 1


class PollAdmin(admin.ModelAdmin):
    model = Poll
    inlines = (ChoiceInline,)
    list_display = ('question', 'count_choices', 'count_total_votes')

admin.site.register(Poll, PollAdmin)

improve poll admin with list display and set model