pytask/profile/templatetags/user_tags.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Sat, 15 Jan 2011 21:22:56 +0530
changeset 419 0bf7c07ef922
parent 307 c6bca38c1cbf
permissions -rw-r--r--
Capitalize the name Notifications.

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'