~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlpoll/admin.py

  • Committer: franku
  • Date: 2016-12-13 18:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161213182851-bo5ebf8pdvw5beua
run the script

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
from models import Poll, Choice
6
6
from django.contrib import admin
7
7
 
 
8
 
8
9
class ChoiceInline(admin.TabularInline):
9
10
    model = Choice
10
11
    extra = 10
11
12
 
 
13
 
12
14
class PollAdmin(admin.ModelAdmin):
13
 
    inlines = [ ChoiceInline ]
14
 
    
15
 
    search_fields = [ "name" ]
16
 
    list_display = ["name", "pub_date"]
17
 
    list_filter = [ "pub_date" ]
 
15
    inlines = [ChoiceInline]
 
16
 
 
17
    search_fields = ['name']
 
18
    list_display = ['name', 'pub_date']
 
19
    list_filter = ['pub_date']
18
20
 
19
21
admin.site.register(Poll, PollAdmin)
20
 
 
21