sdi/forms.py
branchanoop
changeset 41 651b341fd555
parent 25 30baf3c635c5
child 44 ce2b84e6f24a
equal deleted inserted replaced
40:aa5abe1664ce 41:651b341fd555
     1 from django import forms
     1 from django import forms
     2 
     2 
     3 from sage_days.sdi.models import Registrant, TOPICS_CHOICES
     3 from sage_days.sdi.models import Registrant, TOPICS_CHOICES
       
     4 from captcha.fields import CaptchaField
     4 
     5 
     5 class RegisterForm(forms.ModelForm):
     6 class RegisterForm(forms.ModelForm):
     6     """ The form that is displayed to user.
     7     """ The form that is displayed to user.
     7     """
     8     """
     8 
     9 
     9     topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES, required=False)
    10     topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES, required=False)
    10     class Meta:
    11     class Meta:
    11         model = Registrant
    12         model = Registrant
       
    13     captcha = CaptchaField()
    12 
    14 
    13     def clean_email(self):
    15     def clean_email(self):
    14         """ See if the user has already registered using the email.
    16         """ See if the user has already registered using the email.
    15         """
    17         """
    16 
    18