]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
- enhance ClauseAdapter / ColumnAdapter to have new behaviors with labels.
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Sep 2014 04:01:34 +0000 (00:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 7 Sep 2014 04:01:34 +0000 (00:01 -0400)
commit7950270cf2b12807acd7c330b11dae36e50c3a28
treef1ec50aa6fc604d7a2dadf1b41aff73952a05dcc
parente80c7cc5c103788a4c7e1c479af2c37cd9c958b3
- enhance ClauseAdapter / ColumnAdapter to have new behaviors with labels.
The "anonymize label" logic is now generalized to ClauseAdapter, and takes
place when the anonymize_labels flag is sent, taking effect for all
.columns lookups as well as within traverse() calls against the label
directly.
- traverse() will also memoize what it gets in columns, so that
calling upon traverse() / .columns against the same Label will
produce the same anonymized label.  This is so that AliasedClass
produces the same anonymized label when it is accessed per-column
(e.g. SomeAlias.some_column) as well as when it is applied to a Query,
and within column loader strategies (e.g. query(SomeAlias)); the
former uses traverse() while the latter uses .columns
- AliasedClass now calls onto ColumnAdapter
- Query also makes sure to use that same ColumnAdapter from the AliasedClass
in all cases
- update the logic from 0.9 in #1068 to make use of the same
_label_resolve_dict we use for #2992, simplifying how that works
and adding support for new scenarios that were pretty broken
(see #3148, #3188)
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/util.py
test/sql/test_generative.py
test/sql/test_text.py