author | Madhusudan.C.S <madhusudancs@gmail.com> |
Tue, 01 Feb 2011 15:09:44 +0530 | |
changeset 548 | 53b0071346c4 |
parent 419 | 0bf7c07ef922 |
permissions | -rw-r--r-- |
298
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
1 |
from django import template |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
2 |
|
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
3 |
register = template.Library() |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
4 |
|
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
5 |
@register.filter |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
6 |
def notf_dsp(user): |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
7 |
|
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
8 |
notf_cnt = user.notification_sent_to.filter(is_deleted=False, |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
9 |
is_read=False).count() |
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
10 |
|
419
0bf7c07ef922
Capitalize the name Notifications.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
307
diff
changeset
|
11 |
return u'Notifications(%s)'%notf_cnt if notf_cnt else u'Notifications' |
298
696309b5ad59
created a tag and used it in the template
Nishanth Amuluru <nishanth@fossee.in>
parents:
297
diff
changeset
|
12 |