MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / undefer_group

Method undefer_group

lib/sqlalchemy/orm/strategy_options.py:689–720  ·  view source on GitHub ↗

Indicate that columns within the given deferred group name should be undeferred. The columns being undeferred are set up on the mapping as :func:`.deferred` attributes and include a "group" name. E.g:: session.query(MyClass).options(undefer_group("large

(self, name: str)

Source from the content-addressed store, hash-verified

687 )
688
689 def undefer_group(self, name: str) -> Self:
690 """Indicate that columns within the given deferred group name should be
691 undeferred.
692
693 The columns being undeferred are set up on the mapping as
694 :func:`.deferred` attributes and include a "group" name.
695
696 E.g::
697
698 session.query(MyClass).options(undefer_group("large_attrs"))
699
700 To undefer a group of attributes on a related entity, the path can be
701 spelled out using relationship loader options, such as
702 :func:`_orm.defaultload`::
703
704 select(MyClass).options(
705 defaultload("someattr").undefer_group("large_attrs")
706 )
707
708 .. seealso::
709
710 :ref:`orm_queryguide_column_deferral` - in the
711 :ref:`queryguide_toplevel`
712
713 :func:`_orm.defer`
714
715 :func:`_orm.undefer`
716
717 """
718 return self._set_column_strategy(
719 (_WILDCARD_TOKEN,), None, {f"undefer_group_{name}": True}
720 )
721
722 def with_expression(
723 self,

Calls 1

_set_column_strategyMethod · 0.95