diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-02-11 23:29:02 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-02-11 23:29:02 +0000 |
commit | adbd3ae29eefd2f3a34d8dd5166eceff91347557 (patch) | |
tree | 228a4068311fcd5c8ce214476924fc0bee8bdde1 /lib/sqlalchemy/sql.py | |
parent | e7a7708b433f23edc24f364ae2055a9b73f8d207 (diff) | |
download | sqlalchemy-adbd3ae29eefd2f3a34d8dd5166eceff91347557.tar.gz |
more hammering of defaults. ORM will properly execute defaults and post-fetch rows that contain passive defaults
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index c8a05470c..d4ae77a4e 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -638,7 +638,7 @@ class TextClause(ClauseElement): being specified as a bind parameter via the bindparam() method, since it provides more information about what it is, including an optional type, as well as providing comparison operations.""" - def __init__(self, text = "", engine=None, bindparams=None, typemap=None): + def __init__(self, text = "", engine=None, bindparams=None, typemap=None, escape=True): self.parens = False self._engine = engine self.id = id(self) @@ -650,8 +650,11 @@ class TextClause(ClauseElement): def repl(m): self.bindparams[m.group(1)] = bindparam(m.group(1)) return self.engine.bindtemplate % m.group(1) - - self.text = re.compile(r':([\w_]+)', re.S).sub(repl, text) + + if escape: + self.text = re.compile(r':([\w_]+)', re.S).sub(repl, text) + else: + self.text = text if bindparams is not None: for b in bindparams: self.bindparams[b.key] = b |