feedback/views.py
changeset 10 c52d170969f0
parent 5 37e4027fba48
child 11 334550460bd7
equal deleted inserted replaced
9:e29ecb7819e7 10:c52d170969f0
     3 from workshop.feedback.models import Feedback
     3 from workshop.feedback.models import Feedback
     4 from workshop.feedback.forms import FeedbackForm
     4 from workshop.feedback.forms import FeedbackForm
     5 
     5 
     6 from django.http import HttpResponse
     6 from django.http import HttpResponse
     7 
     7 
     8 def submit_feedback(request):
     8 def submit_feedback(request, event_key):
     9     """ see if the ip address has already submitted a feedback.
     9     """ see if the ip address has already submitted a feedback.
    10     if not, collect the feedback.
    10     if not, collect the feedback.
    11     """
    11     """
    12 
    12 
    13     ip = request.META["REMOTE_ADDR"]
    13     ip = request.META["REMOTE_ADDR"]
    22             return render_to_response('feedback.html',{'form':form})
    22             return render_to_response('feedback.html',{'form':form})
    23     else:
    23     else:
    24         form = FeedbackForm()
    24         form = FeedbackForm()
    25         return render_to_response('feedback.html',{'form':form})
    25         return render_to_response('feedback.html',{'form':form})
    26 
    26 
    27 def list_feedbacks(request):
    27 def list_feedbacks(request, event_key):
    28     """ print a list of all the feedbacks collected.
    28     """ print a list of all the feedbacks collected.
    29     """
    29     """
    30 
    30 
    31     feeds = Feedback.objects.all()
    31     feeds = Feedback.objects.all()
    32     return render_to_response('list_feedbacks.html',{'feeds':feeds})
    32     return render_to_response('list_feedbacks.html',{'feeds':feeds})