diff options
author | Nishanth Amuluru | 2011-01-07 15:16:29 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-07 15:16:29 +0530 |
commit | ee9ca4578cda64df058e768de5258426a970b2fb (patch) | |
tree | 9cb2c064d49052cf1c0464a992c63841869ee451 /profile | |
parent | 31fce84c23ca5cf2c7a656143bfa851de34a6e64 (diff) | |
download | pytask-ee9ca4578cda64df058e768de5258426a970b2fb.tar.gz pytask-ee9ca4578cda64df058e768de5258426a970b2fb.tar.bz2 pytask-ee9ca4578cda64df058e768de5258426a970b2fb.zip |
created a tag and used it in the template
Diffstat (limited to 'profile')
-rw-r--r-- | profile/templatetags/user_tags.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/profile/templatetags/user_tags.py b/profile/templatetags/user_tags.py index e69de29..e03aa09 100644 --- a/profile/templatetags/user_tags.py +++ b/profile/templatetags/user_tags.py @@ -0,0 +1,12 @@ +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' + |