summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-12-21 06:57:20 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-12-21 06:57:20 +0000
commitc114f096bd0bd786916cbc42eaa91e0e1158ccf4 (patch)
tree2313856ffc6bfe8a3b61017a58efe98b4be322e7 /lib/sqlalchemy/sql
parent2db36bf59c447d4d113cba0ae12f1b739c2ae923 (diff)
downloadsqlalchemy-c114f096bd0bd786916cbc42eaa91e0e1158ccf4.tar.gz
- reworked all lazy/deferred/expired callables to be
serializable class instances, added pickling tests - cleaned up "deferred" polymorphic system so that the mapper handles it entirely - columns which are missing from a Query's select statement now get automatically deferred during load.
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/expression.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index ff370bc59..df3dbd279 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -47,7 +47,6 @@ __all__ = [
'subquery', 'table', 'text', 'union', 'union_all', 'update', ]
-BIND_PARAMS = re.compile(r'(?<![:\w\x5c]):(\w+)(?!:)', re.UNICODE)
def desc(column):
"""Return a descending ``ORDER BY`` clause element.
@@ -1795,6 +1794,8 @@ class _TextClause(ClauseElement):
__visit_name__ = 'textclause'
+ _bind_params_regex = re.compile(r'(?<![:\w\x5c]):(\w+)(?!:)', re.UNICODE)
+
def __init__(self, text = "", bind=None, bindparams=None, typemap=None):
self._bind = bind
self.bindparams = {}
@@ -1809,7 +1810,7 @@ class _TextClause(ClauseElement):
# scan the string and search for bind parameter names, add them
# to the list of bindparams
- self.text = BIND_PARAMS.sub(repl, text)
+ self.text = self._bind_params_regex.sub(repl, text)
if bindparams is not None:
for b in bindparams:
self.bindparams[b.key] = b