From 8d88a3f238657130ae5a4daf10cac230e8a49deb Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 27 Aug 2025 13:25:11 -0500 Subject: [PATCH] Adjust the querying example in README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2017934..a79f597 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,7 @@ class SecurityAlert(NotificationType): ### Querying Notifications ```python +from generic_notifications.channels import WebsiteChannel from generic_notifications.models import Notification from generic_notifications.lib import get_unread_count, get_notifications, mark_notifications_as_read @@ -237,9 +238,10 @@ unread_count = get_unread_count(user=user, channel=WebsiteChannel) unread_notifications = get_notifications(user=user, channel=WebsiteChannel, unread_only=True) # Get notifications by channel -email_notifications = Notification.objects.for_channel(WebsiteChannel) +website_notifications = Notification.objects.for_channel(WebsiteChannel) # Mark as read +notification = website_notifications.first() notification.mark_as_read() # Mark all as read