chat.collections.message
Attributes
Classes
Abstract base class for generic types. |
Module Contents
- class chat.collections.message.MessageCollection(session: sqlalchemy.orm.Session, type: tuple[str, Ellipsis] | Literal['*'] | None = ..., channel_id: str = '*', newer_than: str | None = None, older_than: str | None = None, limit: int | None = None, load: Literal['older-first', 'newer-first'] = 'older-first')[source]
- class chat.collections.message.MessageCollection(session: sqlalchemy.orm.Session, type: str, channel_id: str = '*', newer_than: str | None = None, older_than: str | None = None, limit: int | None = None, load: Literal['older-first', 'newer-first'] = 'older-first')
Bases:
onegov.core.collection.GenericCollection
[_M
]Abstract base class for generic types.
A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:
class Mapping(Generic[KT, VT]): def __getitem__(self, key: KT) -> VT: ... # Etc.
This class can then be used as follows:
def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default
- add(*, channel_id: str, owner: str | None = None, type: str | None = None, meta: dict[str, Any] = ..., text: str | None = None, created: datetime.datetime = ..., updated: datetime | None = ..., file: MessageFile | None = None, **kwargs: Any) _M [source]
- add(**kwargs: Any) _M