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