Chat

This package contains all chat views

Chat Actions

This module contains action methods for the author chat

integreat_cms.cms.views.chat.chat_actions.delete_chat_message(request: HttpRequest, region_slug: str | None = None, message_id: int | None = None) JsonResponse[source]

Delete chat message

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str | None) – The slug of the current region

  • message_id (int | None) – The id of the message

Raises:

PermissionDenied – If user does not have the permission to delete the specific message

Returns:

A redirection to the PageTreeView

Return type:

JsonResponse

integreat_cms.cms.views.chat.chat_actions.send_chat_message(request: HttpRequest, region_slug: str | None = None) HttpResponse[source]

Send chat message

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str | None) – The slug of the current region

Returns:

A redirection to the PageTreeView

Return type:

HttpResponse

Chat Context Mixin

class integreat_cms.cms.views.chat.chat_context_mixin.ChatContextMixin[source]

Bases: ContextMixin

This mixin provides the chat context for dashboard views (see ContextMixin)

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

Returns the chat context variables chat_form, chat_messages and chat_last_visited.

Returns:

The chat context

Return type:

dict[str, Any]

get_context_data(**kwargs: Any) dict[str, Any][source]

Returns a dictionary representing the template context (see get_context_data()).

Parameters:

**kwargs (Any) – The given keyword arguments

Returns:

The template context

Return type:

dict[str, Any]