event/forms.py
changeset 62 baddb55f8da7
parent 12 81cd0140a0f2
child 63 21cdadb1b98e
--- 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"]