Skip to content

page_views

django_spire.notification.app.views.page_views

app_notification_list_view

Source code in django_spire/notification/app/views/page_views.py
@login_required()
def app_notification_list_view(request: WSGIRequest) -> TemplateResponse:
    app_notification_list = (
        AppNotification.objects.active()
        .is_sent()
        .annotate_is_viewed_by_user(request.user)
        .select_related('notification')
        .distinct()
        .ordered_by_priority_and_sent_datetime()
    )

    return portal_views.list_view(
        request,
        context_data={'notification_list': app_notification_list},
        model=AppNotification,
        template='django_spire/notification/app/page/list_page.html'
    )