management.models.notificationsΒΆ
Module that contains all models corresponding to the devices app.
Module ContentsΒΆ
- class management.models.notifications.NotificationStatus(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelModel representing a status a notification can have.
- class management.models.notifications.NotificationMessageModel(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelMessage Model for Notifications with Short and Optional Long Descriptions.
- class management.models.notifications.NotificationMessage(short_description, long_description='No description provided')[source]ΒΆ
Class for notification content with short and optional long descriptions.
- Parameters:
short_description (django_stubs_ext.StrOrPromise)
long_description (django_stubs_ext.StrOrPromise)
- class management.models.notifications.NotificationModel(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelNotifications Model.
- class NotificationTypes(*args, **kwds)[source]ΒΆ
Bases:
django.db.models.TextChoicesSupported Notification Types.
- class NotificationSource(*args, **kwds)[source]ΒΆ
Bases:
django.db.models.TextChoicesOrigin of the Notification.
- class NotificationMessageType(*args, **kwds)[source]ΒΆ
Bases:
django.db.models.TextChoicesTypes of messages (aka. unique strings to that particular notification).
- get_notification_type_display()[source]ΒΆ
Gets the notification type as human-readable string for displaying in the front-end.
- Returns:
Human-readable string for displaying in the front-end.
- Return type:
str
- class management.models.notifications.WeakECCCurve(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelRepresents a weak or deprecated ECC curve.
- objects: django.db.models.Manager[WeakECCCurve][source]ΒΆ
- class management.models.notifications.WeakSignatureAlgorithm(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelRepresents a weak or deprecated signature algorithm.
- objects: django.db.models.Manager[WeakSignatureAlgorithm][source]ΒΆ
- class management.models.notifications.NotificationConfig(*args, **kwargs)[source]ΒΆ
Bases:
django.db.models.ModelStores global configuration for notification thresholds and behaviors.
- objects: django.db.models.Manager[NotificationConfig][source]ΒΆ
- property next_notification_check_scheduled_at: datetime.datetime | None[source]ΒΆ
Returns when the next notification check is scheduled.
Queries Django-Q2βs schedule table to find the next scheduled notification check.
- Returns:
- The scheduled time for the next notification check,
or None if not enabled or not scheduled.
- Return type:
datetime | None
- schedule_next_notification_check(cycle_interval_hours=None)[source]ΒΆ
Schedule the next notification execution using Django-Q2.
Creates a scheduled task in Django-Q2 that will execute all notifications at the calculated time. The task will automatically trigger notification checks without manual intervention.
- Parameters:
cycle_interval_hours (float | None) β The number of hours until the next notification check should run. If None, uses the modelβs notification_cycle_interval_hours setting.
- Return type:
None