sdi/forms.py
branchanoop
changeset 56 7dfacad8adee
parent 45 29d7d70c9273
child 68 b0e630caa6e6
--- a/sdi/forms.py	Sun Jun 06 01:31:03 2010 +0530
+++ b/sdi/forms.py	Sun Jun 06 17:32:50 2010 +0530
@@ -135,3 +135,15 @@
         else:
             raise forms.ValidationError("Invalid range for Likeliness of attending the workshop")
                    
+class EmailForm(forms.Form):
+    """ Take a list of csv seperated email addresses.
+    """
+
+    emails = forms.CharField(widget=forms.Textarea, required=False)
+
+    def clean_emails(self):
+        emails = self.cleaned_data['emails']
+
+        to_emails = [csv_list.split(',') for csv_list in emails.split()]
+        return to_emails
+