diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2021-02-02 20:49:41 +0100 |
|---|---|---|
| committer | Federico Caselli <cfederico87@gmail.com> | 2021-02-02 20:49:41 +0100 |
| commit | 71c13990aa1ea7af8777aae4a2a26d3f6d6e8a0a (patch) | |
| tree | d3aa9359c736429eab45bb1b835160272a9248ea /lib/sqlalchemy | |
| parent | a7eeac60cae28bb553327d317a88adb22c799ef3 (diff) | |
| download | sqlalchemy-71c13990aa1ea7af8777aae4a2a26d3f6d6e8a0a.tar.gz | |
Improve noload documentation
Also add a link to the loading strategies doc from the
async orm docs
Fixes: #5832
Change-Id: I41170369273df7d323f7140cd05759567484dc4d
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/strategy_options.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index fbecfedeb..f24f42a6b 100644 --- a/lib/sqlalchemy/orm/strategy_options.py +++ b/lib/sqlalchemy/orm/strategy_options.py @@ -1341,12 +1341,20 @@ def immediateload(*keys): def noload(loadopt, attr): """Indicate that the given relationship attribute should remain unloaded. + The relationship attribute will return ``None`` when accessed without + producing any loading effect. + This function is part of the :class:`_orm.Load` interface and supports both method-chained and standalone operation. :func:`_orm.noload` applies to :func:`_orm.relationship` attributes; for column-based attributes, see :func:`_orm.defer`. + .. note:: Setting this loading strategy as the default strategy + for a relationship using the :paramref:`.orm.relationship.lazy` + parameter may cause issues with flushes, such if a delete operation + needs to load related objects and instead ``None`` was returned. + .. seealso:: :ref:`loading_toplevel` |
