pytask/profile/templatetags/user_tags.py
author Nishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 22:40:19 +0530
changeset 334 3e0636969095
parent 307 c6bca38c1cbf
child 419 0bf7c07ef922
permissions -rw-r--r--
Added task urls to main urls

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'