core.orm.utils ============== .. py:module:: core.orm.utils Attributes ---------- .. autoapisummary:: core.orm.utils._T Classes ------- .. autoapisummary:: core.orm.utils.QueryChain Functions --------- .. autoapisummary:: core.orm.utils.maybe_merge core.orm.utils.requires_merge Module Contents --------------- .. py:data:: _T .. py:class:: QueryChain(queries, limit=None, offset=None) Bases: :py:obj:`sqlalchemy_utils.QueryChain` Extends SQLAlchemy Utils' QueryChain with some extra methods. .. py:method:: slice(start: int | None, end: int | None) -> Self .. py:method:: first() -> _T | None .. py:method:: all() -> tuple[_T, Ellipsis] .. py:function:: maybe_merge(session: sqlalchemy.orm.Session, obj: _T) -> _T Merges the given obj into the given session, *if* this is possible. That is it acts like more forgiving session.merge(). .. py:function:: requires_merge(obj: object) -> bool Returns true if the given object requires a merge, which is the case if the object is detached.