X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5f176bb52a7a59bf88f5728e60a3a62e12fb3d54..5158c6e72fb24c87dd8c42a8d171222f1ee1d803:/apps/polls/forms.py?ds=inline diff --git a/apps/polls/forms.py b/apps/polls/forms.py index f9ca9078a..20d53fe33 100644 --- a/apps/polls/forms.py +++ b/apps/polls/forms.py @@ -1,10 +1,14 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import forms class PollForm(forms.Form): - vote = forms.ChoiceField(widget = forms.RadioSelect) - + vote = forms.ChoiceField(widget=forms.RadioSelect) + def __init__(self, *args, **kwargs): poll = kwargs.pop('poll', None) super(PollForm, self).__init__(*args, **kwargs) - self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()] \ No newline at end of file + self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]