diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-02-03 21:30:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2021-02-03 21:30:51 +0000 |
| commit | cce7120b758782cf4a3b5fc9453e5f11832bae9b (patch) | |
| tree | 07003542070ffd5722bc9dcdce12805f5391c7e0 /lib/sqlalchemy | |
| parent | 496efe51262be77d73ed514c4de16cdc2da2d435 (diff) | |
| parent | 71c13990aa1ea7af8777aae4a2a26d3f6d6e8a0a (diff) | |
| download | sqlalchemy-cce7120b758782cf4a3b5fc9453e5f11832bae9b.tar.gz | |
Merge "Improve noload documentation"
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` |
