summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/strategy_options.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-06-26 13:24:22 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-06-26 13:49:49 -0400
commit9ac0f8119e34a696fbf711e00262e9c0851b749c (patch)
treef05beb1e57e70d4e286ac8b068f992f4fb52b59c /lib/sqlalchemy/orm/strategy_options.py
parente04594339c19c3cd8b8e0d96ce83e5ded961dbb7 (diff)
downloadsqlalchemy-9ac0f8119e34a696fbf711e00262e9c0851b749c.tar.gz
Support state expiration for with_expression(); rename deferred_expression
The attributeimpl for a deferred_expression does not support a scalar loader, add new configurability so that the impl can have this flag turned off. Document that the with_expression() system currently does not offer any deferred loading. To eliminate confusion over "deferred", which refers to lazy loading of column attributes, and "with_expression", which refers to an attribute that is explicitly at query time only, rename deferred_expression to query_expression. Change-Id: I07c4a050ed68c79ccbde9492e9de1630b7470d74
Diffstat (limited to 'lib/sqlalchemy/orm/strategy_options.py')
-rw-r--r--lib/sqlalchemy/orm/strategy_options.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py
index 2cdf6ba95..796f859f8 100644
--- a/lib/sqlalchemy/orm/strategy_options.py
+++ b/lib/sqlalchemy/orm/strategy_options.py
@@ -1356,7 +1356,7 @@ from .util import _orm_full_deannotate
def with_expression(loadopt, key, expression):
r"""Apply an ad-hoc SQL expression to a "deferred expression" attribute.
- This option is used in conjunction with the :func:`.orm.deferred_expression`
+ This option is used in conjunction with the :func:`.orm.query_expression`
mapper-level construct that indicates an attribute which should be the
target of an ad-hoc SQL expression.
@@ -1375,7 +1375,7 @@ def with_expression(loadopt, key, expression):
.. seealso::
- :ref:`mapper_deferred_expression`
+ :ref:`mapper_query_expression`
"""
@@ -1384,7 +1384,7 @@ def with_expression(loadopt, key, expression):
return loadopt.set_column_strategy(
(key, ),
- {"deferred_expression": True},
+ {"query_expression": True},
opts={"expression": expression}
)