Mercurial > public > sg101
annotate gpp/polls/forms.py @ 63:5899e308cdb3
Sigh, changed the donations data format because it seems to be different than the stand-alone IPN tester. The month name doesn't have a dot after it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 27 Jun 2009 21:40:04 +0000 |
parents | dbd703f7d63a |
children | 1f139de929c4 |
rev | line source |
---|---|
gremmie@1 | 1 """Forms for the Polls application.""" |
gremmie@1 | 2 |
gremmie@1 | 3 from django import forms |
gremmie@1 | 4 |
gremmie@1 | 5 from polls.models import Choice |
gremmie@1 | 6 |
gremmie@1 | 7 |
gremmie@1 | 8 class VoteForm(forms.Form): |
gremmie@1 | 9 """Form for voting in a poll.""" |
gremmie@1 | 10 choices = forms.ModelChoiceField(label='', empty_label=None, |
gremmie@1 | 11 queryset=Choice.objects.none(), widget=forms.RadioSelect) |
gremmie@1 | 12 |
gremmie@1 | 13 def __init__(self, poll, *args, **kwargs): |
gremmie@1 | 14 super(VoteForm, self).__init__(*args, **kwargs) |
gremmie@1 | 15 self.fields['choices'].queryset = poll.choice_set.all() |
gremmie@1 | 16 |