summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-04-29 21:33:05 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-04-29 21:33:05 +0000
commit8d5a0729abff9fe4ac86f49d810564037a68b0e3 (patch)
tree5107f342b6bd5221e5e8c487fc672d009db0c998 /lib/sqlalchemy/sql.py
parent05f1e509518f62d2cdf8cc697e5bf6d4108df432 (diff)
downloadsqlalchemy-8d5a0729abff9fe4ac86f49d810564037a68b0e3.tar.gz
- the label() method on ColumnElement will properly propigate the
TypeEngine of the base element out to the label, including a label() created from a scalar=True select() statement.
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r--lib/sqlalchemy/sql.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index 988366617..a7ca55e31 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -2360,7 +2360,7 @@ class _Label(ColumnElement):
obj = obj.obj
self.obj = obj
self.case_sensitive = getattr(obj, "case_sensitive", True)
- self.type = sqltypes.to_instance(type)
+ self.type = sqltypes.to_instance(type or getattr(obj, 'type', None))
obj.parens=True
key = property(lambda s: s.name)