So many things get better/are improved, but only things that are to be done or broken...
[wolnelektury.git] / apps / polls / admin.py
1 from django.contrib import admin
2
3 from models import Poll, PollItem
4
5
6 class PollItemInline(admin.TabularInline):
7     model = PollItem
8     extra = 0
9     readonly_fields = ('vote_count',)
10     
11     
12 class PollAdmin(admin.ModelAdmin):
13     inlines = [PollItemInline]
14     
15
16 class PollItemAdmin(admin.ModelAdmin):
17     readonly_fields = ('vote_count',)
18     
19     
20 admin.site.register(Poll, PollAdmin)
21 admin.site.register(PollItem, PollItemAdmin)