core.orm.utils

Attributes

_T

Classes

QueryChain

Extends SQLAlchemy Utils' QueryChain with some extra methods.

Functions

maybe_merge(→ _T)

Merges the given obj into the given session, if this is possible.

requires_merge(→ bool)

Returns true if the given object requires a merge, which is the

Module Contents

core.orm.utils._T[source]
class core.orm.utils.QueryChain(queries, limit=None, offset=None)[source]

Bases: sqlalchemy_utils.QueryChain

Extends SQLAlchemy Utils’ QueryChain with some extra methods.

slice(start: int | None, end: int | None) Self[source]
first() _T | None[source]
all() tuple[_T, Ellipsis][source]
core.orm.utils.maybe_merge(session: sqlalchemy.orm.Session, obj: _T) _T[source]

Merges the given obj into the given session, if this is possible. That is it acts like more forgiving session.merge().

core.orm.utils.requires_merge(obj: object) bool[source]

Returns true if the given object requires a merge, which is the case if the object is detached.