X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5d4057337796667537724950ed99aafe3edaa9d9..9203d27cee887569ad260dd91d798df68a1d3ada:/apps/polls/admin.py?ds=inline diff --git a/apps/polls/admin.py b/apps/polls/admin.py new file mode 100644 index 000000000..29fc0aaec --- /dev/null +++ b/apps/polls/admin.py @@ -0,0 +1,21 @@ +from django.contrib import admin + +from models import Poll, PollItem + + +class PollItemInline(admin.TabularInline): + model = PollItem + extra = 0 + readonly_fields = ('vote_count',) + + +class PollAdmin(admin.ModelAdmin): + inlines = [PollItemInline] + + +class PollItemAdmin(admin.ModelAdmin): + readonly_fields = ('vote_count',) + + +admin.site.register(Poll, PollAdmin) +admin.site.register(PollItem, PollItemAdmin) \ No newline at end of file