From ee9ca4578cda64df058e768de5258426a970b2fb Mon Sep 17 00:00:00 2001 From: Nishanth Amuluru Date: Fri, 7 Jan 2011 15:16:29 +0530 Subject: created a tag and used it in the template --- profile/templatetags/user_tags.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'profile') diff --git a/profile/templatetags/user_tags.py b/profile/templatetags/user_tags.py index e69de29..e03aa09 100644 --- a/profile/templatetags/user_tags.py +++ b/profile/templatetags/user_tags.py @@ -0,0 +1,12 @@ +from django import template + +register = template.Library() + +@register.filter +def notf_dsp(user): + + notf_cnt = user.notification_sent_to.filter(is_deleted=False, + is_read=False).count() + + return u'notifications(%s)'%notf_cnt if notf_cnt else u'notifications' + -- cgit