added 500 template and added clean on comments and added comments in view report.
authornishanth
Sat, 17 Apr 2010 13:15:05 +0530
changeset 94 5de0009c0d71
parent 93 cd76d507b6cf
child 95 f5ae0bcb044e
added 500 template and added clean on comments and added comments in view report.
feedback/forms.py
feedback/views.py
templates/505.html
--- a/feedback/forms.py	Sat Apr 17 11:40:17 2010 +0530
+++ b/feedback/forms.py	Sat Apr 17 13:15:05 2010 +0530
@@ -8,5 +8,8 @@
 
     class Meta:
         model = Feedback
-        exclude = ['user_ip', 'event', 'day']
+        exclude = [ 'event', 'day']
 
+    def clean_comments(self):
+        comments = self.cleaned_data['comments']
+        return comments.strip()
--- a/feedback/views.py	Sat Apr 17 11:40:17 2010 +0530
+++ b/feedback/views.py	Sat Apr 17 13:15:05 2010 +0530
@@ -107,6 +107,12 @@
         day_feeds = Feedback.objects.filter(event=event,day=day_num)
         day_report = make_day_report(day_feeds) 
         if day_report:
+            day_comments = "Comments: <br /><ol>"
+            for feed in day_feeds:
+                if feed.comments:
+                    day_comments += "<li>%s</li>"%feed.comments
+            day_comments += "</ol>"
+            day_report.append(day_comments)
             workshop_report.extend( [ "Day %s"%day_num, day_report] )
 
     return render_to_response("show_report.html", {"user":user, "event":event, "workshop_report":workshop_report})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/505.html	Sat Apr 17 13:15:05 2010 +0530
@@ -0,0 +1,5 @@
+{% extends "base.html" %}
+{% block content %}
+500 Error<br />
+Server encountered some error. This event will be reported.<br />
+{% endblock %}