chat.collections.chat

Module Contents

Classes

ChatCollection

Manages a list of chats.

class chat.collections.chat.ChatCollection(session: sqlalchemy.orm.Session, page: int = 0, state: str = 'active', group: str | None = None, owner: str = '*')[source]

Bases: onegov.core.collection.GenericCollection[onegov.chat.models.Chat], onegov.core.collection.Pagination[onegov.chat.models.Chat]

Manages a list of chats.

Use it like this:

from onegov.people import ChatCollection
chats = ChatCollection(session)
property page_index: int[source]

Returns the current page index (starting at 0).

property name_of_view: str[source]

The name of the view to link to. If omitted, the the default view is looked up..

property model_class: type[onegov.chat.models.Chat][source]
__eq__(other: object) bool[source]

Return self==value.

subset() Query[Chat][source]

Returns an SQLAlchemy query containing all records that should be considered for pagination.

page_by_index(index: int) typing_extensions.Self[source]

Returns the page at the given index. A page here means an instance of the class inheriting from the Pagination base class.

add(customer_name: str, email: str, topic: str, **kwargs: Any) onegov.chat.models.Chat[source]