pytask/profile/templatetags/user_tags.py
changeset 69 c6bca38c1cbf
parent 60 696309b5ad59
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pytask/profile/templatetags/user_tags.py	Sat Jan 08 11:20:57 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'
+