mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Add an example to the notification documentation
This commit is contained in:
parent
42ee06470c
commit
07c62ed32a
@ -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
|
from .core import notify # noqa: F401
|
||||||
|
Loading…
x
Reference in New Issue
Block a user