pytask/profile/templatetags/user_tags.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 04 Feb 2011 16:38:21 +0530
changeset 558 fd3e6f5f01bd
parent 419 0bf7c07ef922
permissions -rw-r--r--
Use the form helpers templatetag module in the addreviewer template.

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'