pytask/profile/templatetags/user_tags.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 12:30:10 +0530
changeset 140 8fcde6f8f750
parent 69 c6bca38c1cbf
permissions -rw-r--r--
added view_user functionality

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'