Mercurial > public > sg101
comparison gpp/polls/admin.py @ 1:dbd703f7d63a
Initial import of sg101 stuff from private repository.
author | gremmie |
---|---|
date | Mon, 06 Apr 2009 02:43:12 +0000 |
parents | |
children | 1f139de929c4 |
comparison
equal
deleted
inserted
replaced
0:900ba3c7b765 | 1:dbd703f7d63a |
---|---|
1 ''' | |
2 This file contains the automatic admin site definitions for the polls models. | |
3 ''' | |
4 | |
5 from django.contrib import admin | |
6 from polls.models import Poll | |
7 from polls.models import Choice | |
8 | |
9 | |
10 class ChoiceInline(admin.TabularInline): | |
11 model = Choice | |
12 extra = 3 | |
13 | |
14 | |
15 class PollAdmin(admin.ModelAdmin): | |
16 list_display = ('question', 'start_date', 'end_date', 'is_enabled') | |
17 inlines = (ChoiceInline, ) | |
18 list_filter = ('start_date', 'end_date') | |
19 search_fields = ('question', ) | |
20 date_hierarchy = 'start_date' | |
21 | |
22 | |
23 admin.site.register(Poll, PollAdmin) |