MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / noload

Method noload

lib/sqlalchemy/orm/strategy_options.py:492–508  ·  view source on GitHub ↗

Indicate that the given relationship attribute should remain unloaded. The relationship attribute will return ``None`` when accessed without producing any loading effect. :func:`_orm.noload` applies to :func:`_orm.relationship` attributes only. .. s

(self, attr: _AttrType)

Source from the content-addressed store, hash-verified

490 "items.",
491 )
492 def noload(self, attr: _AttrType) -> Self:
493 """Indicate that the given relationship attribute should remain
494 unloaded.
495
496 The relationship attribute will return ``None`` when accessed without
497 producing any loading effect.
498
499 :func:`_orm.noload` applies to :func:`_orm.relationship` attributes
500 only.
501
502 .. seealso::
503
504 :ref:`loading_toplevel`
505
506 """
507
508 return self._set_relationship_strategy(attr, {"lazy": "noload"})
509
510 def raiseload(self, attr: _AttrType, sql_only: bool = False) -> Self:
511 """Indicate that the given attribute should raise an error if accessed.

Callers 4

load_options_okFunction · 0.80
load_options_errorFunction · 0.80
goMethod · 0.80

Calls 1

Tested by 2

goMethod · 0.64