1 from django import forms
\r
4 class PollForm(forms.Form):
\r
5 vote = forms.ChoiceField(widget = forms.RadioSelect)
\r
7 def __init__(self, *args, **kwargs):
8 poll = kwargs.pop('poll', None)
\r
9 super(PollForm, self).__init__(*args, **kwargs)
\r
10 self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()]