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: CustomModelForm

Form for creating and modifying push notification objects

Form fields:

Parameters:
  • regions (QuerySet | None) –

  • selected_regions (list[Region] | None) –

  • disabled (bool) –

  • template (bool) –

  • kwargs (Any) –

__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

Parameters:
  • **kwargs (Any) – The supplied keyword arguments

  • regions (QuerySet | None) –

  • selected_regions (list[Region] | None) –

  • disabled (bool) –

  • template (bool) –

  • **kwargs

Return type:

None

clean() dict[str, Any][source]

Validate form fields which depend on each other, see django.forms.Form.clean()

Returns:

The cleaned form data

Return type:

dict[str, Any]

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: CustomModelForm

Form for creating and modifying push notification translation objects

Form fields:

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 True if submitted data differs from initial data. If the main language should be used as fallback for missing translations, this always return True.

Returns:

Whether the form has changed

Return type:

bool

property media[source]

Return all media required to render the widgets on this form.