chat.collections.chat

Classes

ChatCollection

Manages a list of chats.

Module Contents

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)
session[source]
page[source]
state[source]
group[source]
owner[source]
__eq__(other: object) bool[source]

Returns True if the current and the other Pagination instance are equal. Used to find the current page in a list of pages.

subset() Query[Chat][source]

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

property page_index: int[source]

Returns the current page index (starting at 0).

page_by_index(index: int) Self[source]

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

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]
add(customer_name: str, email: str, topic: str, **kwargs: Any) onegov.chat.models.Chat[source]