1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from django import forms
7 class PollForm(forms.Form):
8 vote = forms.ChoiceField(widget=forms.RadioSelect)
10 def __init__(self, *args, **kwargs):
11 poll = kwargs.pop('poll', None)
12 super(PollForm, self).__init__(*args, **kwargs)
13 self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]