Package: notifications-plugin
Notifications PluginIntroductionA Django app to create notificationsRequirementsPython 3.5, 3.6, 3.7, 3.8Django 2.2, 3.0InstallationInstall the app using pip$ pip install notifications-pluginor get it from source$ git clone https://github.com/adityacp/notifications_plugin.git
$ cd notifications_plugin
$ python setup.py sdist
$ pip install dist/notifications_plugin*Add the django app to your ProjectINSTALLED_APPS = (
    'django.contrib.auth',
    ...
    'notifications_plugin',
    ...
)To run schema migration, executepython manage.py makemigrations notifications_pluginand then runpython manage.py migrate.Creating NotificationsQuerySet methodsCreate Single notification messageTo add an notification message, simply import the NotificationMessage model from the notifications_plugin app.from notifications_plugin.models import NotificationMessage

NotificationMessage.objects.add_single_message(creator_id, summary, description, msg_type)Arguments:creator_id: An user’s id who is creating the message.summary: A summary of the messagedescription: A description of the actual messagemsg_type: Message Type i.e. whether it is informational message, danger message, success message or warning message.     Default is the informational message (info).Available message types are info, danger, warning, success.Create Bulk notification MessageNotificationMessage.objects.add_bulk_messages(messages)Arguments:messsages: A list of dictionaries containing the following values. Sample messages list is as followsmessages =[{"creator_id": 1, "summary" : "test", "description": "test description", "message_type":"info"}]Create notificationsTo create notification for multiple receivers with single messagefrom notifications_plugin.models import Notification

Notification.objects.add_bulk_user_notifications(receiver_ids, msg_id)Arguments:receiver_ids: A list of receiver ids to whom the notification is to be sentmsg_id: A NotificationMessage id which will be sent to the receiversTo create notification for single receiver with multiple messagesNotification.objects.add_bulk_msg_notifications(receiver_id, msg_ids)To create notification for single receiver with single messageNotification.objects.add_single_notification(receiver_id, msg_id)Getting and Marking NotificationsTo mark notifications for multiple receivers with single messageNotification.objects.mark_bulk_user_notifications(receiver_ids, msg_uuid, read)Arguments:receiver_ids: A list of receiver ids to whose notification is to be markedmsg_id: A NotificationMessage uuid(unique identifier) whose message is supposed to be marked. To get the uuid of the message just typemessage.uidread: Indicates if the message for the particular receiver is marked or not. Default isFalse. To mark as read, make itTrue.To mark notifications for single receiver with multiple messagesNotification.objects.mark_bulk_msg_notifications(receiver_id, msg_uuids, read)To mark notification for single receiver with single messageNotification.objects.mark_single_notification(receiver_id, msg_uuid, read)To get a particular receiver’s all notificationsNotification.objects.get_receiver_notifications(receiver_id)To get unread notifications of a particular receiverNotification.objects.get_unread_receiver_notifications(receiver_id)To get read notifications of a particular receiverNotification.objects.get_read_receiver_notifications(receiver_id)To get multiple receivers notificationsNotification.objects.get_multiple_user_notifications(receiver_ids)To get notifications by a specific messageNotification.objects.get_notifications_by_msg(msg_uuid)IssuesIf you find any issues or want a specific functionality, please file a issue here:https://github.com/adityacp/notifications_plugin/issues/new/choose