# HG changeset patch # User Nishanth Amuluru # Date 1294382526 -19800 # Node ID 8318df7e2d52382bee1ef6d063a31e6ccdc45652 # Parent ee00b42e802f0fcb3c3a5f63fdfbce5f299e56d1 created a view for browising thro notifications diff -r ee00b42e802f -r 8318df7e2d52 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)