added new field "need_acco" in search form anoop
authornishanth
Wed, 14 Jul 2010 10:16:53 +0530
branchanoop
changeset 77 616a0357b2c9
parent 76 acbe60359ac1
child 78 e84f56d4968e
added new field "need_acco" in search form
sdi/forms.py
sdi/views.py
--- a/sdi/forms.py	Fri Jul 02 17:32:15 2010 +0530
+++ b/sdi/forms.py	Wed Jul 14 10:16:53 2010 +0530
@@ -41,6 +41,7 @@
     knowledge_of_sage = forms.CharField(required=False, help_text=" Give single number from 1 to 5 or a range seperated by hyphen")
     likeliness_of_attending = forms.CharField(required=False, help_text=" Give single number from 1 to 5 or a range seperated by hyphen")
     need_for_python_workshop = forms.BooleanField(required=False)
+    need_accomodation = forms.BooleanField(required=False)
 
     def clean_topics_interested(self):
         """ split and return include list and exclude list
--- a/sdi/views.py	Fri Jul 02 17:32:15 2010 +0530
+++ b/sdi/views.py	Wed Jul 14 10:16:53 2010 +0530
@@ -47,7 +47,8 @@
         if form.is_valid():
             data = form.cleaned_data
             need_workshop = data['need_for_python_workshop']
-            db_query = "Registrant.objects.filter(need_for_python_workshop=%s)"%need_workshop
+            acco_required = data['need_accomodation']
+            db_query = "Registrant.objects.filter(need_for_python_workshop=%s, acco_required=%s)"%(need_workshop, acco_required)
 
             topics_include, topics_exclude = data['topics_interested']
             for number in topics_include: