From 07c62ed32a273ede5cf4fe935f81a4fba6329e90 Mon Sep 17 00:00:00 2001 From: r0kym Date: Mon, 23 Sep 2024 13:15:19 +0200 Subject: [PATCH] Add an example to the notification documentation --- allianceauth/notifications/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/allianceauth/notifications/__init__.py b/allianceauth/notifications/__init__.py index 1a7c9e01..74122db7 100644 --- a/allianceauth/notifications/__init__.py +++ b/allianceauth/notifications/__init__.py @@ -1 +1,21 @@ +""" +Example +======= + +.. code-block:: python + + from allianceauth.notifications.models import Notification + + + def notify_user_view(request): + '''Simple view sending a notification to the user''' + + Notification.objects.notify_user( + user=request.user, + title="Some title", + message="Some message", + level=Notification.Level.INFO, + ) + +""" from .core import notify # noqa: F401