notifications.views¶
Defines views for the notifications application.
Classes¶
View to execute all notifications and redirect back to dashboard. |
|
View to delete a notification. |
Module Contents¶
- class notifications.views.RefreshNotificationsView(**kwargs)[source]¶
Bases:
trustpoint.logger.LoggerMixin,django.views.generic.TemplateViewView to execute all notifications and redirect back to dashboard.
- get(request, *args, **kwargs)[source]¶
Handles GET requests and redirects to the dashboard.
- Parameters:
request (django.http.HttpRequest) – The HTTP request object.
*args (Any) – Additional positional arguments.
**kwargs (Any) – Keyword arguments passed to super().get_context_data.
- Returns:
dashboard.
- Return type:
The response that redirects the user to home
- class notifications.views.NotificationDeleteView[source]¶
Bases:
trustpoint.logger.LoggerMixin,django.views.generic.DeleteView[notifications.models.NotificationModel,Any]View to delete a notification.
- model: type[notifications.models.NotificationModel][source]¶
- delete(request, *args, **kwargs)[source]¶
Override delete method to add a success message.
- Parameters:
request (django.http.HttpRequest) – The HTTP request object.
*args (Any) – Additional positional arguments.
**kwargs (Any) – Keyword arguments passed to super().delete.
- Returns:
The HTTP response redirecting to success_url.
- Return type:
django.http.HttpResponse