Push Notifications
Forms for creating and modifying push notification and push notification translation objects
Push Notification Form
- class integreat_cms.cms.forms.push_notifications.push_notification_form.PushNotificationForm(regions: QuerySet | None = None, selected_regions: list[Region] | None = None, disabled: bool = False, template: bool = False, **kwargs: Any)[source]
Bases:
CustomModelFormForm for creating and modifying push notification objects
Form fields:
channel: Channel (TypedChoiceField)regions: Regions (ModelMultipleChoiceField)mode: Mode (TypedChoiceField)scheduled_send_date: Scheduled send date (DateTimeField)is_template: News template (BooleanField)template_name: News template name (CharField)schedule_send: Schedule sending (BooleanField)scheduled_send_date_day: Scheduled send day (DateField)scheduled_send_date_time: Scheduled send time (TimeField)
- Parameters:
- __init__(regions: QuerySet | None = None, selected_regions: list[Region] | None = None, disabled: bool = False, template: bool = False, **kwargs: Any) None[source]
Initialize push notification form
- clean() dict[str, Any][source]
Validate form fields which depend on each other, see
django.forms.Form.clean()
- property media[source]
Return all media required to render the widgets on this form.
Push Notification Translation Form
- class integreat_cms.cms.forms.push_notifications.push_notification_translation_form.PushNotificationTranslationForm(**kwargs: Any)[source]
Bases:
CustomModelFormForm for creating and modifying push notification translation objects
Form fields:
title: Title (CharField)text: Content (CharField)language: Language (ModelChoiceField)
- Parameters:
kwargs (Any)
- add_error_messages(request: HttpRequest) None[source]
This function overwrites
add_error_messages()to add the language of the current translation to the error messages- Parameters:
request (HttpRequest) – The current request submitting the form
- Return type:
None
- has_changed() bool[source]
Return
Trueif submitted data differs from initial data. If the main language should be used as fallback for missing translations, this always returnTrue.- Returns:
Whether the form has changed
- Return type:
- property media[source]
Return all media required to render the widgets on this form.