summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-12-21 16:34:00 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2010-12-21 16:34:00 -0500
commitdff4e0591eee3def7c4c38666c8fc581c327aa87 (patch)
tree12893840b5b95948b124161f036c6c85f52e2a8d /lib/sqlalchemy/engine/base.py
parentb0f48ca2a910e0a8527b9640c56cc3f342f4f31d (diff)
downloadsqlalchemy-dff4e0591eee3def7c4c38666c8fc581c327aa87.tar.gz
- apply pep8 to compiler.py
- deprecate Compiled.compile() - have __init__ do compilation if statement is present.
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r--lib/sqlalchemy/engine/base.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 4e11117f7..1e5285b35 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -675,14 +675,17 @@ class Compiled(object):
"""
self.dialect = dialect
- self.statement = statement
self.bind = bind
- self.can_execute = statement.supports_execution
+ if statement is not None:
+ self.statement = statement
+ self.can_execute = statement.supports_execution
+ self.string = self.process(self.statement)
+ @util.deprecated("0.7", ":class:`.Compiled` objects now compile "
+ "within the constructor.")
def compile(self):
"""Produce the internal string representation of this element."""
-
- self.string = self.process(self.statement)
+ pass
@property
def sql_compiler(self):