# HG changeset patch # User Nishanth Amuluru # Date 1294393589 -19800 # Node ID 696309b5ad590c6803f9a65f00e9737ae77fc1ce # Parent 1d04840fdcb805663420b3c98ff3ae9e68d74285 created a tag and used it in the template diff -r 1d04840fdcb8 -r 696309b5ad59 profile/templatetags/user_tags.py --- a/profile/templatetags/user_tags.py Fri Jan 07 14:57:52 2011 +0530 +++ b/profile/templatetags/user_tags.py Fri Jan 07 15:16:29 2011 +0530 @@ -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' + diff -r 1d04840fdcb8 -r 696309b5ad59 templates/base.html --- a/templates/base.html Fri Jan 07 14:57:52 2011 +0530 +++ b/templates/base.html Fri Jan 07 15:16:29 2011 +0530 @@ -4,6 +4,7 @@ {% block js_script %} {% endblock %} +{% load user_tags %}