feedback/views.py
changeset 39 61d558a69b0d
parent 38 b63b78017225
child 41 ab0a8a72b069
--- a/feedback/views.py	Thu Apr 15 11:57:42 2010 +0530
+++ b/feedback/views.py	Thu Apr 15 12:36:21 2010 +0530
@@ -63,8 +63,17 @@
         raise Http404
 
     no_of_days = (event.stop_date - event.start_date).days
-    days = range(1,no_of_days+1)
-
+    days = range(1,no_of_days+2)
 
-    return render_to_response('list_feedbacks.html',{'user':user, 'event':event})
+    feeds_list = []
+    for day in days:
+        day_feeds = Feedback.objects.filter(event=event,day=day)
+        if day_feeds.count():
+            day_list = []
+            for feed in day_feeds:
+                day_list.append(" ".join((feed.topics, feed.depth, feed.methodology, feed.pace,
+                                feed.applicability, feed.problems, feed.exercises, feed.comments)))
+            feeds_list.append(["Day %s"%day, day_list])
 
+    return render_to_response('list_feedbacks.html',{'user':user, 'event':event, 'feeds_list':feeds_list})
+