pytask/profile/templatetags/user_tags.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 28 Jan 2011 02:27:40 +0530
changeset 519 84709567f47a
parent 419 0bf7c07ef922
permissions -rw-r--r--
Use the release version of South than the latest version. South is very critical for our application. So don't take any risk with the users data. Use the release version.

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'