2024-03-10 19:37:46 +05:30
|
|
|
""" Django notification urls file """
|
|
|
|
|
|
2023-08-01 16:47:47 +05:30
|
|
|
# -*- coding: utf-8 -*-
|
2024-05-07 12:23:36 +05:30
|
|
|
from distutils.version import ( # pylint: disable=no-name-in-module,import-error
|
2024-03-10 19:37:46 +05:30
|
|
|
StrictVersion,
|
2024-05-07 12:23:36 +05:30
|
|
|
)
|
2023-08-01 16:47:47 +05:30
|
|
|
|
|
|
|
|
from django import get_version
|
2024-12-31 18:56:48 +05:30
|
|
|
from django.urls import path
|
2023-08-01 16:47:47 +05:30
|
|
|
|
|
|
|
|
from . import views
|
|
|
|
|
|
2024-03-10 19:37:46 +05:30
|
|
|
if StrictVersion(get_version()) >= StrictVersion("2.0"):
|
2023-08-01 16:47:47 +05:30
|
|
|
from django.urls import re_path as pattern
|
|
|
|
|
else:
|
|
|
|
|
from django.conf.urls import url as pattern
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
2024-03-10 19:37:46 +05:30
|
|
|
pattern(r"^$", views.AllNotificationsList.as_view(), name="all"),
|
|
|
|
|
pattern(r"^unread/$", views.UnreadNotificationsList.as_view(), name="unread"),
|
|
|
|
|
pattern(r"^mark-all-as-read/$", views.mark_all_as_read, name="mark_all_as_read"),
|
|
|
|
|
pattern(r"^mark-as-read/(?P<slug>\d+)/$", views.mark_as_read, name="mark_as_read"),
|
|
|
|
|
pattern(
|
|
|
|
|
r"^mark-as-unread/(?P<slug>\d+)/$", views.mark_as_unread, name="mark_as_unread"
|
|
|
|
|
),
|
|
|
|
|
pattern(r"^delete/(?P<slug>\d+)/$", views.delete, name="delete"),
|
|
|
|
|
pattern(
|
|
|
|
|
r"^api/unread_count/$",
|
|
|
|
|
views.live_unread_notification_count,
|
|
|
|
|
name="live_unread_notification_count",
|
|
|
|
|
),
|
|
|
|
|
pattern(
|
|
|
|
|
r"^api/all_count/$",
|
|
|
|
|
views.live_all_notification_count,
|
|
|
|
|
name="live_all_notification_count",
|
|
|
|
|
),
|
|
|
|
|
pattern(
|
|
|
|
|
r"^api/unread_list/$",
|
|
|
|
|
views.live_unread_notification_list,
|
|
|
|
|
name="live_unread_notification_list",
|
|
|
|
|
),
|
|
|
|
|
pattern(
|
|
|
|
|
r"^api/all_list/",
|
|
|
|
|
views.live_all_notification_list,
|
|
|
|
|
name="live_all_notification_list",
|
|
|
|
|
),
|
2024-12-31 18:56:48 +05:30
|
|
|
path(
|
|
|
|
|
"notification-sound",
|
|
|
|
|
views.notification_sound,
|
|
|
|
|
name="notification-sound",
|
|
|
|
|
),
|
2023-08-01 16:47:47 +05:30
|
|
|
]
|
|
|
|
|
|
2024-03-10 19:37:46 +05:30
|
|
|
app_name = "notifications"
|