Chat

This package contains all models for the author chat

Chat Message

class integreat_cms.cms.models.chat.chat_message.ChatHistoryManager(*args, **kwargs)[source]

Bases: Manager

Custom manager for returning the chat history of the last x days (as configured in AUTHOR_CHAT_HISTORY_DAYS)

get_queryset() QuerySet[source]

Custom queryset with applied filters to return the chat messages of the last x days

Returns:

The QuerySet of the most recent chat history

Return type:

QuerySet

class integreat_cms.cms.models.chat.chat_message.ChatMessage(*args, **kwargs)[source]

Bases: AbstractBaseModel

A model for a message in the author chat

Parameters:

Relationship fields:

Parameters:

sender (ForeignKey to User) – Sender (related name: chat_messages)

exception DoesNotExist[source]

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <ChatMessage: ChatMessage object (id)>. It is used for logging.

Returns:

The canonical string representation of the chat message

Return type:

str

history = <integreat_cms.cms.models.chat.chat_message.ChatHistoryManager object>[source]

Django manager to access the ORM Use ChatMessage.objects.all() to fetch all objects.

A manager for the most recent chat history

objects = <django.db.models.Manager object>[source]

Django manager to access the ORM Use ChatMessage.objects.all() to fetch all objects.

The default manager