~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlpoll/admin.py

  • Committer: Holger Rapp
  • Date: 2009-02-19 15:31:42 UTC
  • Revision ID: sirver@h566336-20090219153142-dc8xuabldnw5t395
Initial commit of new widelands homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python -tt
2
 
# encoding: utf-8
3
 
#
4
 
 
5
 
from models import Poll, Choice
6
 
from django.contrib import admin
7
 
 
8
 
 
9
 
class ChoiceInline(admin.TabularInline):
10
 
    model = Choice
11
 
    extra = 10
12
 
 
13
 
 
14
 
class PollAdmin(admin.ModelAdmin):
15
 
    inlines = [ChoiceInline]
16
 
 
17
 
    search_fields = ['name']
18
 
    list_display = ['name', 'pub_date']
19
 
    list_filter = ['pub_date']
20
 
 
21
 
admin.site.register(Poll, PollAdmin)