profile/views.py
changeset 38 c8c47fcb46f0
parent 37 c701e68f8d35
child 44 69d1c4b99503
--- a/profile/views.py	Fri Jan 07 12:21:43 2011 +0530
+++ b/profile/views.py	Fri Jan 07 12:35:18 2011 +0530
@@ -57,3 +57,29 @@
               }                               
 
     return render_to_response('profile/browse_notifications.html', context)
+
+@login_required
+def view_notification(request, nid):
+    """ get the notification depending on nid.
+    Display it.
+    """
+
+    user = get_user(request.user)
+    newest, newer, notification, older, oldest =
+    get_notification(nid, user)
+
+    if not notification:
+        raise Http404
+
+    notification.is_read = True
+    notification.save()
+
+    context = {'user':user,
+               'notification':notification,
+               'newest':newest,
+               'newer':newer,
+               'older':older,
+               'oldest':oldest,
+              }
+
+    return render_to_response('profile/view_notification.html', context)