From: Mike Bayer Date: Sun, 4 Feb 2007 03:50:54 +0000 (+0000) Subject: polymorphic union uses the literal_column function for its "textual" column X-Git-Tag: rel_0_3_5~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94c612e10687a6ff187aca70d96ef89637ab025f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git polymorphic union uses the literal_column function for its "textual" column --- diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index 3ac1ac7f66..293ec03770 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -59,7 +59,7 @@ def polymorphic_union(table_map, typecolname, aliasname='p_union'): result = [] for type, table in table_map.iteritems(): if typecolname is not None: - result.append(sql.select([col(name, table) for name in colnames] + [sql.column("'%s'" % type).label(typecolname)], from_obj=[table])) + result.append(sql.select([col(name, table) for name in colnames] + [sql.literal_column("'%s'" % type).label(typecolname)], from_obj=[table])) else: result.append(sql.select([col(name, table) for name in colnames], from_obj=[table])) return sql.union_all(*result).alias(aliasname)