summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/baked.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ext/baked.py')
-rw-r--r--lib/sqlalchemy/ext/baked.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py
index 249f5db4e..95b618f3f 100644
--- a/lib/sqlalchemy/ext/baked.py
+++ b/lib/sqlalchemy/ext/baked.py
@@ -127,7 +127,7 @@ class BakedQuery(object):
invocation.
"""
- if not full:
+ if not full and not self._spoiled:
_spoil_point = self._clone()
_spoil_point._cache_key += ('_query_only', )
self.steps = [_spoil_point._retrieve_baked_query]
@@ -157,6 +157,7 @@ class BakedQuery(object):
self.spoil()
elif cache_key is not None:
key += cache_key
+
self.add_criteria(
lambda q: q._with_current_path(effective_path).
_conditional_options(*options),