profile/templatetags/user_tags.py
changeset 60 696309b5ad59
parent 59 1d04840fdcb8
--- 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'
+