diff options
author | Nishanth Amuluru | 2011-01-07 12:12:06 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-07 12:12:06 +0530 |
commit | a283be285af46a29fd774199fb58385ca68ba009 (patch) | |
tree | 1526b6bd9f8db8a66982592a7010feaa47984388 | |
parent | 949f3bcd8fd30365808b0a38a15da91b1ea2b3a3 (diff) | |
download | pytask-a283be285af46a29fd774199fb58385ca68ba009.tar.gz pytask-a283be285af46a29fd774199fb58385ca68ba009.tar.bz2 pytask-a283be285af46a29fd774199fb58385ca68ba009.zip |
created a view for browising thro notifications
-rwxr-xr-x | profile/views.py | 14 |
1 files changed, 14 insertions, 0 deletions
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) |