mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-03-16 21:30:24 +00:00
Merge pull request #137 from zhang-z/master
Return updated count in QuerySet
This commit is contained in:
commit
9f3e0105c2
1 changed files with 4 additions and 4 deletions
|
|
@ -71,7 +71,7 @@ class NotificationQuerySet(models.query.QuerySet):
|
|||
if recipient:
|
||||
qs = qs.filter(recipient=recipient)
|
||||
|
||||
qs.update(unread=False)
|
||||
return qs.update(unread=False)
|
||||
|
||||
def mark_all_as_unread(self, recipient=None):
|
||||
"""Mark as unread any read messages in the current queryset.
|
||||
|
|
@ -83,7 +83,7 @@ class NotificationQuerySet(models.query.QuerySet):
|
|||
if recipient:
|
||||
qs = qs.filter(recipient=recipient)
|
||||
|
||||
qs.update(unread=True)
|
||||
return qs.update(unread=True)
|
||||
|
||||
def deleted(self):
|
||||
"""Return only deleted items in the current queryset"""
|
||||
|
|
@ -104,7 +104,7 @@ class NotificationQuerySet(models.query.QuerySet):
|
|||
if recipient:
|
||||
qs = qs.filter(recipient=recipient)
|
||||
|
||||
qs.update(deleted=True)
|
||||
return qs.update(deleted=True)
|
||||
|
||||
def mark_all_as_active(self, recipient=None):
|
||||
"""Mark current queryset as active(un-deleted).
|
||||
|
|
@ -115,7 +115,7 @@ class NotificationQuerySet(models.query.QuerySet):
|
|||
if recipient:
|
||||
qs = qs.filter(recipient=recipient)
|
||||
|
||||
qs.update(deleted=False)
|
||||
return qs.update(deleted=False)
|
||||
|
||||
|
||||
class Notification(models.Model):
|
||||
|
|
|
|||
Loading…
Reference in a new issue