created a form for opening quiz
authornishanth
Tue, 29 Jun 2010 12:09:03 +0530
changeset 62 baddb55f8da7
parent 61 3b8b0ce51566
child 63 21cdadb1b98e
created a form for opening quiz
event/forms.py
--- a/event/forms.py	Tue Jun 29 11:49:04 2010 +0530
+++ b/event/forms.py	Tue Jun 29 12:09:03 2010 +0530
@@ -1,6 +1,7 @@
 from django import forms
 
-from offline.event.models import Event
+from offline.event.models import Event, QUIZ_CHOICES
+from offline.quiz.models import TOPICS_CHOICES
 
 class EventCreateForm(forms.ModelForm):
 
@@ -21,3 +22,11 @@
 
         return self.cleaned_data['stop_date']
 
+class OpenQuizForm(forms.Form):
+
+    quiz_num = forms.ChoiceField(required=True, widget=forms.RadioSelect, choices=QUIZ_CHOICES)
+    topics = forms.MultipleChoiceField(required=True, widget=forms.CheckboxSelectMultiple, choices=TOPIC_CHOICES,)
+    
+    def clean_topics(self):
+
+        return self.cleaned_data["topics"]