Author: brosner
Date: Fri Mar 13 00:01:32 2009
New Revision: 159
Modified:
trunk/notification/context_processors.py
trunk/notification/models.py
Log:
Only count on_site notices in the context processor (also unseen_count_for
now calls notices_for).
Modified: trunk/notification/context_processors.py
==============================================================================
--- trunk/notification/context_processors.py (original)
+++ trunk/notification/context_processors.py Fri Mar 13 00:01:32 2009
@@ -2,6 +2,8 @@
def notification(request):
if request.user.is_authenticated():
- return {'notice_unseen_count':
Notice.objects.unseen_count_for(request.user),}
+ return {
+ 'notice_unseen_count':
Notice.objects.unseen_count_for(request.user, on_site=True),
+ }
else:
return {}
Modified: trunk/notification/models.py
==============================================================================
--- trunk/notification/models.py (original)
+++ trunk/notification/models.py Fri Mar 13 00:01:32 2009
@@ -114,12 +114,12 @@
qs = qs.filter(on_site=on_site)
return qs
- def unseen_count_for(self, user):
+ def unseen_count_for(self, user, **kwargs):
"""
returns the number of unseen notices for the given user but does
not
mark them seen
"""
- return self.filter(user=user, unseen=True).count()
+ return self.notices_for(user, unseen=True, **kwargs).count()
class Notice(models.Model):
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---