diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-10-01 20:55:42 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-10-01 20:55:42 -0400 |
commit | 4557fd5a9af9ad4d93ab1eacef4b7e059bb10dc3 (patch) | |
tree | a1d8ddf554a913b5e2b55153029db66e12aa256c /lib/sqlalchemy/orm/util.py | |
parent | 846c9e17056e65554cf226abe71d2d0c68108bc9 (diff) | |
download | sqlalchemy-4557fd5a9af9ad4d93ab1eacef4b7e059bb10dc3.tar.gz |
- Fixed bug in query.update() where 'evaluate' or 'fetch'
expiration would fail if the column expression key was
a class attribute with a different keyname as the
actual column name. [ticket:1935]
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index d68ff4473..f79a8449f 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -582,6 +582,12 @@ def _orm_selectable(entity): mapper, selectable, is_aliased_class = _entity_info(entity) return selectable +def _attr_as_key(attr): + if hasattr(attr, 'key'): + return attr.key + else: + return expression._column_as_key(attr) + def _is_aliased_class(entity): return isinstance(entity, AliasedClass) |