found easier way to get things done. so removed all the junk code.
authornishanth
Fri, 02 Jul 2010 14:12:25 +0530
changeset 87 e81b105b1128
parent 86 404e9c1b8cff
child 88 281c4bcf848f
found easier way to get things done. so removed all the junk code.
event/views.py
quiz/models.py
--- a/event/views.py	Thu Jul 01 17:05:57 2010 +0530
+++ b/event/views.py	Fri Jul 02 14:12:25 2010 +0530
@@ -221,7 +221,7 @@
     if request.method == "POST":
         pass
     else:
-        form = EditQuestionForm(q.get_values())
+        form = EditQuestionForm(instance=q)
         return render_to_response("edit_question.html", {"form":form,"admin_key":ADMIN_KEY})
 
 
--- a/quiz/models.py	Thu Jul 01 17:05:57 2010 +0530
+++ b/quiz/models.py	Fri Jul 02 14:12:25 2010 +0530
@@ -43,18 +43,6 @@
     time_limit = models.PositiveSmallIntegerField()
     expected_ans = models.TextField()
 
-    def get_values(self):
-
-        values_dict = {"quiz_num" : self.quiz_num,
-                       "topic" : self.topic,
-                       "description" : self.description,
-                       "code" : self.code,
-                       "options" : self.options,
-                       "time_limit" : self.time_limit,
-                       "expected_ans" : self.expected_ans,
-                      }
-        return values_dict
-
     def __unicode__(self):
 
         return self.description