sdi/forms.py
changeset 20 9db4ee082d4e
parent 19 3932d9426c44
child 21 3d7a52d9ed2e
equal deleted inserted replaced
19:3932d9426c44 20:9db4ee082d4e
     4 
     4 
     5 class RegisterForm(forms.ModelForm):
     5 class RegisterForm(forms.ModelForm):
     6     """ The form that is displayed to user.
     6     """ The form that is displayed to user.
     7     """
     7     """
     8 
     8 
     9     topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES)       
     9     topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES, required=False)
    10     class Meta:
    10     class Meta:
    11         model = Registrant
    11         model = Registrant
    12 
    12 
       
    13     def clean_topics_interested(self):
       
    14         """ Join the choices using PIPE character and store them.
       
    15         """
       
    16 
       
    17         topics = self.cleaned_data['topics_interested']
       
    18         return "|".join(topics)