profile/templatetags/user_tags.py
author Nishanth Amuluru <nishanth@fossee.in>
Sat, 08 Jan 2011 01:45:57 +0530
changeset 301 e346fd52baff
parent 298 696309b5ad59
permissions -rw-r--r--
fixed a typo

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'