|
@@ -1,16 +1,11 @@
|
|
|
from django import forms
|
|
|
+from .validators import zip_code_validator
|
|
|
+from .models import AgeRange
|
|
|
|
|
|
-from .models import Voter, VoterQuestion, Question, Vote
|
|
|
|
|
|
-
|
|
|
-class VoterForm(forms.ModelForm):
|
|
|
- class Meta:
|
|
|
- model = Voter
|
|
|
- fields = ['first_name', 'last_name', 'age_range', 'zip_code']
|
|
|
-
|
|
|
-
|
|
|
-class VoterQuestionForm(forms.ModelForm):
|
|
|
- class Meta:
|
|
|
- model = VoterQuestion
|
|
|
- fields = ['question', 'vote']
|
|
|
+class VoterRegistrationForm(forms.Form):
|
|
|
+ first_name = forms.CharField(max_length=100)
|
|
|
+ last_name = forms.CharField(max_length=100)
|
|
|
+ age_range = forms.ModelChoiceField(queryset=AgeRange.objects.all())
|
|
|
+ zip_code = forms.CharField(max_length=5)
|
|
|
|