gremmie@1: ''' gremmie@1: This file contains the automatic admin site definitions for the polls models. gremmie@1: ''' gremmie@1: gremmie@1: from django.contrib import admin gremmie@1: from polls.models import Poll gremmie@1: from polls.models import Choice gremmie@1: gremmie@1: gremmie@1: class ChoiceInline(admin.TabularInline): gremmie@1: model = Choice gremmie@1: extra = 3 gremmie@1: gremmie@1: gremmie@1: class PollAdmin(admin.ModelAdmin): gremmie@1: list_display = ('question', 'start_date', 'end_date', 'is_enabled') gremmie@1: inlines = (ChoiceInline, ) gremmie@1: list_filter = ('start_date', 'end_date') gremmie@1: search_fields = ('question', ) gremmie@1: date_hierarchy = 'start_date' gremmie@1: gremmie@1: gremmie@1: admin.site.register(Poll, PollAdmin)