added the topics field in register form
authornishanth
Sat, 29 May 2010 15:39:55 +0530
changeset 19 3932d9426c44
parent 18 7d587311a4b5
child 20 9db4ee082d4e
added the topics field in register form
sdi/forms.py
sdi/models.py
--- a/sdi/forms.py	Sat May 29 11:41:52 2010 +0530
+++ b/sdi/forms.py	Sat May 29 15:39:55 2010 +0530
@@ -1,10 +1,12 @@
 from django import forms
 
-from sage_days.sdi.models import Registrant
+from sage_days.sdi.models import Registrant, TOPICS_CHOICES
 
 class RegisterForm(forms.ModelForm):
     """ The form that is displayed to user.
     """
 
+    topics_interested = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=TOPICS_CHOICES)       
     class Meta:
         model = Registrant
+
--- a/sdi/models.py	Sat May 29 11:41:52 2010 +0530
+++ b/sdi/models.py	Sat May 29 15:39:55 2010 +0530
@@ -18,6 +18,13 @@
                           ("1", "No clue what Sage is"),
                          )
 
+TOPICS_CHOICES = (("1", "Topic 1"),
+                  ("2", "Topic 2"),
+                  ("3", "Topic 3"),
+                  ("4", "Topic 4"),
+                  ("5", "Topic 5"),
+                 )
+
 LIKELINESS_CHOICES = (('5', "Will attend at any cost"),
                       ('4', "Will attend most probably"),
                       ('3', "Unsure of attending"),
@@ -35,7 +42,7 @@
     gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
 
     profession = models.CharField(max_length=20)
-    affiliated_to = models.CharField(max_length=30)
+    affiliated_to = models.CharField(max_length=30, verbose_name="Affiliated Institution/Company")
 
     topics_interested = models.CharField(max_length=30, blank=True)
 
@@ -45,7 +52,8 @@
     knowledge_of_sage = models.CharField(max_length=1, choices=SAGE_KNOWLEDGE_CHOICES)
     tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True)
 
-    address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True)
+    #address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True)
+    address = models.TextField(blank=True)
     phone_num = models.CharField(max_length=15, verbose_name="Phone Number", blank=True)
 
     likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES)