mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-05-20 10:21:53 +00:00
9 lines
299 B
Python
9 lines
299 B
Python
from django.db import models
|
|
|
|
|
|
class NotificationManager(models.Manager):
|
|
def unread_count(self, user):
|
|
return self.filter(recipient=user, readed=False).count()
|
|
|
|
def mark_all_as_read(self, recipient):
|
|
return self.filter(recipient=recipient, readed=False).update(readed=True)
|