summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-04-29 19:46:43 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-31 21:41:52 -0400
commit4ecd352a9fbb9dbac7b428fe0f098f665c1f0cb1 (patch)
tree323868c9f18fffdbfef6168622010c7d19367b12 /lib/sqlalchemy/ext/compiler.py
parentcbfa1363d7201848a56e7209146e81b9c51aa8af (diff)
downloadsqlalchemy-4ecd352a9fbb9dbac7b428fe0f098f665c1f0cb1.tar.gz
Improve rendering of core statements w/ ORM elements
This patch contains a variety of ORM and expression layer tweaks to support ORM constructs in select() statements, without the 1.3.x requiremnt in Query that a full _compile_context() + new select() is needed in order to get a working statement object. Includes such tweaks as the ability to implement aliased class of an aliased class, as we are looking to fully support ACs against subqueries, as well as the ability to access anonymously-labeled ColumnProperty expressions within subqueries by naming the ".key" of the label after the property key. Some tuning to query.join() as well as ORMJoin internals to allow things to work more smoothly. Change-Id: Id810f485c5f7ed971529489b84694e02a3356d6d
Diffstat (limited to 'lib/sqlalchemy/ext/compiler.py')
-rw-r--r--lib/sqlalchemy/ext/compiler.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py
index 32975a949..7736a1290 100644
--- a/lib/sqlalchemy/ext/compiler.py
+++ b/lib/sqlalchemy/ext/compiler.py
@@ -401,7 +401,6 @@ Example usage::
from .. import exc
from .. import util
from ..sql import sqltypes
-from ..sql import visitors
def compiles(class_, *specs):
@@ -456,12 +455,12 @@ def compiles(class_, *specs):
def deregister(class_):
"""Remove all custom compilers associated with a given
- :class:`_expression.ClauseElement` type."""
+ :class:`_expression.ClauseElement` type.
+
+ """
if hasattr(class_, "_compiler_dispatcher"):
- # regenerate default _compiler_dispatch
- visitors._generate_compiler_dispatch(class_)
- # remove custom directive
+ class_._compiler_dispatch = class_._original_compiler_dispatch
del class_._compiler_dispatcher