diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 16:34:00 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 16:34:00 -0500 |
commit | dff4e0591eee3def7c4c38666c8fc581c327aa87 (patch) | |
tree | 12893840b5b95948b124161f036c6c85f52e2a8d /lib/sqlalchemy/engine/base.py | |
parent | b0f48ca2a910e0a8527b9640c56cc3f342f4f31d (diff) | |
download | sqlalchemy-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.py | 11 |
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): |