core.orm.utils ============== .. py:module:: core.orm.utils Classes ------- .. autoapisummary:: core.orm.utils.QueryChain core.orm.utils.QueryChain Functions --------- .. autoapisummary:: core.orm.utils.maybe_merge core.orm.utils.requires_merge Module Contents --------------- .. py:class:: QueryChain[T] Bases: :py:obj:`sqlalchemy_utils.QueryChain`\ [\ :py:obj:`T`\ ] .. py:method:: slice(start: int | None, end: int | None) -> Self .. py:method:: first() -> T | None .. py:method:: all() -> tuple[T, Ellipsis] .. py:class:: QueryChain[T](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[T](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.