feedback/models.py
changeset 11 334550460bd7
parent 10 c52d170969f0
child 12 f57b0a7f24d9
--- a/feedback/models.py	Mon Apr 12 04:23:13 2010 +0530
+++ b/feedback/models.py	Mon Apr 12 11:23:27 2010 +0530
@@ -44,26 +44,24 @@
     """
 
     user_ip = models.CharField(max_length=15)
-    event = models.ForeignKey(Event)
-    day = models.PositiveIntegerField(default=1)
+    event = models.ForeignKey(Event, related_name="%(class)s")
+    day = models.CharField(max_length=1, default='1')
 
-    range_of_topics = models.CharField(max_length=1, choices=TOPICS_CHOICES,
-                                       verbose_name="Range of topics covered", blank=True)
-    depth_of_coverage = models.CharField(max_length=1, choices=DEPTH_CHOICES, blank=True)
-    effectiveness_of_methodology = models.CharField(max_length=1, choices=METHODOLOGY_CHOICES, blank=True)
-    pace_of_coverage = models.CharField(max_length=1, choices=PACE_CHOICES, blank=True)
+    topics = models.CharField(max_length=1, choices=TOPICS_CHOICES,
+                              verbose_name="Range of topics covered", blank=True)
+    depth = models.CharField(max_length=1, choices=DEPTH_CHOICES, 
+                             verbose_name="Depth of coverage", blank=True)
+    methodology = models.CharField(max_length=1, choices=METHODOLOGY_CHOICES,
+                                   verbose_name="Effectiveness of methodology", blank=True)
+    pace = models.CharField(max_length=1, choices=PACE_CHOICES,
+                            verbose_name="Pace of coverage", blank=True)
     applicability = models.CharField(max_length=1, choices=APPLICABILITY_CHOICES, blank=True)
-    choice_of_problems = models.CharField(max_length=1, choices=PROBLEMS_CHOICES, blank=True)
-    choice_of_exercises = models.CharField(max_length=1, choices=EXERCISES_CHOICES, blank=True)
+    problems = models.CharField(max_length=1, choices=PROBLEMS_CHOICES,
+                                verbose_name="Choice of problems", blank=True)
+    exercises = models.CharField(max_length=1, choices=EXERCISES_CHOICES,
+                                 verbose_name="Choice of exercises", blank=True)
     comments = models.TextField(verbose_name="General comments", blank=True)
 
     def __unicode__(self):
         
-        return unicode(self.range_of_topics +
-                       self.depth_of_coverage +
-                       self.effectiveness_of_methodology +
-                       self.pace_of_coverage +
-                       self.applicability +
-                       self.choice_of_problems +
-                       self.choice_of_exercises
-                      )
+        return unicode(event.title)