diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-05 16:46:24 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-05-05 16:46:24 +0000 |
commit | fd5543b78e071a24652ab040c3029b7aea29f7d7 (patch) | |
tree | a912aaf5ff10d21c838b0a1efca65427bdc4d41f /lib/sqlalchemy/engine/base.py | |
parent | 635e61bdebfc8fefb93cad2550b1342c43b63186 (diff) | |
download | sqlalchemy-fd5543b78e071a24652ab040c3029b7aea29f7d7.tar.gz |
- same as [ticket:1019] but repaired the non-labeled use case
[ticket:1022]
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index d7c7cebaa..583a02763 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -1481,13 +1481,12 @@ class ResultProxy(object): rec = props[key] except KeyError: # fallback for targeting a ColumnElement to a textual expression - # it would be nice to get rid of this but we make use of it in the case where - # you say something like query.options(contains_alias('fooalias')) - the matching - # is done on strings + # this is a rare use case which only occurs when matching text() + # constructs to ColumnElements if isinstance(key, expression.ColumnElement): if key._label and key._label.lower() in props: return props[key._label.lower()] - elif key.name.lower() in props: + elif hasattr(key, 'name') and key.name.lower() in props: return props[key.name.lower()] raise exceptions.NoSuchColumnError("Could not locate column in row for column '%s'" % (str(key))) |