summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-09-26 17:08:19 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-09-26 17:08:19 +0000
commit3e672bbfc8d284b58208987d5fb858e424d02111 (patch)
treef0ddef9742f0a25f93922cdb429dec68e3139e10 /lib/sqlalchemy/engine/base.py
parent9d16ae440b416358b469e6881f1203095233c37c (diff)
downloadsqlalchemy-3e672bbfc8d284b58208987d5fb858e424d02111.tar.gz
- created a link between QueryContext and SelectionContext; the attribute
dictionary of QueryContext is now passed to SelectionContext inside of Query.instances(), allowing messages to be passed between the two stages. - removed the recent "exact match" behavior of Alias objects, they're back to their usual behavior. - tightened up the relationship between the Query's generation of "eager load" aliases, and Query.instances() which actually grabs the eagerly loaded rows. If the aliases were not specifically generated for that statement by EagerLoader, the EagerLoader will not take effect when the rows are fetched. This prevents columns from being grabbed accidentally as being part of an eager load when they were not meant for such, which can happen with textual SQL as well as some inheritance situations. It's particularly important since the "anonymous aliasing" of columns uses simple integer counts now to generate labels.
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r--lib/sqlalchemy/engine/base.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 7e9d57d97..ad2b5df96 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -1287,19 +1287,9 @@ class ResultProxy(object):
elif isinstance(key, basestring) and key.lower() in props:
rec = props[key.lower()]
elif isinstance(key, expression.ColumnElement):
- try:
- if getattr(key, '_exact_match', False):
- # exact match flag means the label must be present in the
- # generated column_labels
- label = context.column_labels[key._label].lower()
- else:
- # otherwise, fall back to the straight name of the column
- # if not in generated labels
- label = context.column_labels.get(key._label, key.name).lower()
- if label in props:
- rec = props[label]
- except KeyError:
- pass
+ label = context.column_labels.get(key._label, key.name).lower()
+ if label in props:
+ rec = props[label]
if not "rec" in locals():
raise exceptions.NoSuchColumnError("Could not locate column in row for column '%s'" % (str(key)))