summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-03-08 15:32:21 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-03-08 15:32:21 -0400
commita421106c9d1d660af7c5d9aba5928dda20c950e1 (patch)
tree504426815dc61a86db8ea217a2c9f921fca03599 /lib/sqlalchemy/orm
parenta92f6662b4e15d5924a686a46d1a6d9b7aa958d5 (diff)
downloadsqlalchemy-a421106c9d1d660af7c5d9aba5928dda20c950e1.tar.gz
- random performance whacking vs. 0.9, in particular we have to watch
for the slots-based __getattr__ thing getting hit
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/base.py2
-rw-r--r--lib/sqlalchemy/orm/query.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py
index 875443e60..c3f95fa10 100644
--- a/lib/sqlalchemy/orm/base.py
+++ b/lib/sqlalchemy/orm/base.py
@@ -327,7 +327,7 @@ def _is_mapped_class(entity):
insp = inspection.inspect(entity, False)
return insp is not None and \
- hasattr(insp, "mapper") and \
+ not insp.is_clause_element and \
(
insp.is_mapper
or insp.is_aliased_class
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index eac2da083..fdee986d3 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -3342,6 +3342,12 @@ class Bundle(object):
"""If True, queries for a single Bundle will be returned as a single
entity, rather than an element within a keyed tuple."""
+ is_clause_element = False
+
+ is_mapper = False
+
+ is_aliased_class = False
+
def __init__(self, name, *exprs, **kw):
"""Construct a new :class:`.Bundle`.