created a view for browising thro notifications
authorNishanth Amuluru <nishanth@fossee.in>
Fri, 07 Jan 2011 12:12:06 +0530
changeset 273 8318df7e2d52
parent 272 ee00b42e802f
child 274 5cd56898033c
created a view for browising thro notifications
profile/views.py
--- a/profile/views.py	Fri Jan 07 11:53:11 2011 +0530
+++ b/profile/views.py	Fri Jan 07 12:12:06 2011 +0530
@@ -42,3 +42,17 @@
         form = EditProfileForm(instance=profile)
         context.update({"form":form})
         return render_to_response("profile/edit.html", context)
+
+@login_required
+def browse_notifications(request):
+    """ get the list of notifications that are not deleted and display in
+    datetime order."""
+
+    user = get_user(request.user)
+
+    active_notifications = user.notification_sent_to.filter(is_deleted=False).order_by('sent_date').reverse()
+
+    context = {'user':user,
+               'notifications':active_notifications,
+              }                               
+    return render_to_response('profile/browse_notifications.html', context)