core.orm.utils

Classes

QueryChain

Extends SQLAlchemy Utils' QueryChain with some extra methods.

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

class core.orm.utils.QueryChain[T][source]

Bases: sqlalchemy_utils.QueryChain[T]

slice(start: int | None, end: int | None) Self[source]
first() T | None[source]
all() tuple[T, Ellipsis][source]
class core.orm.utils.QueryChain[T](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[T](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.