diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-15 20:07:13 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-15 20:07:13 -0400 |
commit | 2484ef34c27f3342e62bd6285bb3668e2c913090 (patch) | |
tree | e7e329fb3e06e903c793f6944a1facd72b0bd4ef /lib/sqlalchemy/engine/result.py | |
parent | af3c8a75c8e9eba593f6568187226548f1b8735d (diff) | |
download | sqlalchemy-2484ef34c27f3342e62bd6285bb3668e2c913090.tar.gz |
- [feature] The Query can now load entity/scalar-mixed
"tuple" rows that contain
types which aren't hashable, by setting the flag
"hashable=False" on the corresponding TypeEngine object
in use. Custom types that return unhashable types
(typically lists) can set this flag to False.
[ticket:2592]
- [bug] Applying a column expression to a select
statement using a label with or without other
modifying constructs will no longer "target" that
expression to the underlying Column; this affects
ORM operations that rely upon Column targeting
in order to retrieve results. That is, a query
like query(User.id, User.id.label('foo')) will now
track the value of each "User.id" expression separately
instead of munging them together. It is not expected
that any users will be impacted by this; however,
a usage that uses select() in conjunction with
query.from_statement() and attempts to load fully
composed ORM entities may not function as expected
if the select() named Column objects with arbitrary
.label() names, as these will no longer target to
the Column objects mapped by that entity.
[ticket:2591]
Diffstat (limited to 'lib/sqlalchemy/engine/result.py')
-rw-r--r-- | lib/sqlalchemy/engine/result.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py index 9fb735f46..6962a4d1e 100644 --- a/lib/sqlalchemy/engine/result.py +++ b/lib/sqlalchemy/engine/result.py @@ -228,16 +228,20 @@ class ResultMetaData(object): # is interpreted later as an AmbiguousColumnError, # but only when actually accessed. Columns # colliding by name is not a problem if those names - # aren't used; integer and ColumnElement access is always + # aren't used; integer access is always # unambiguous. primary_keymap[name if self.case_sensitive - else name.lower()] = rec = (processor, obj, None) + else name.lower()] = rec = (None, obj, None) self.keys.append(colname) if obj: for o in obj: keymap[o] = rec + # technically we should be doing this but we + # are saving on callcounts by not doing so. + # if keymap.setdefault(o, rec) is not rec: + # keymap[o] = (None, obj, None) if translate_colname and \ untranslated: |