From a283be285af46a29fd774199fb58385ca68ba009 Mon Sep 17 00:00:00 2001 From: Nishanth Amuluru Date: Fri, 7 Jan 2011 12:12:06 +0530 Subject: created a view for browising thro notifications --- profile/views.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/profile/views.py b/profile/views.py index 68e22d0..b6da227 100755 --- a/profile/views.py +++ b/profile/views.py @@ -42,3 +42,17 @@ def edit_profile(request): 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) -- cgit