]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- can again create aliases of selects against textual
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Feb 2008 23:46:14 +0000 (23:46 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Feb 2008 23:46:14 +0000 (23:46 +0000)
FROM clauses, [ticket:975]

CHANGES
lib/sqlalchemy/sql/expression.py
test/sql/select.py

diff --git a/CHANGES b/CHANGES
index cd8c1de4a7ba812492f7d91fa77af19794c71441..53f4258e6b6bd0e3b7a75524fdd569728725be85 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,10 @@ CHANGES
 =======
 0.4.4
 ------
+- sql
+    - can again create aliases of selects against textual
+      FROM clauses, [ticket:975]
+      
 - orm
     - any(), has(), contains(), attribute level == and != now
       work properly with self-referential relations - the clause
index b39e406da199ae9a075acd016071c6c66ef8a762..e39487c548839866f075330cebde5ecf17e8457b 100644 (file)
@@ -1718,6 +1718,7 @@ class _TextFromClause(FromClause):
 
     def __init__(self, text):
         self.name = text
+        self.oid_column = None
 
 class _BindParamClause(ClauseElement, _CompareMixin):
     """Represent a bind parameter.
index 39906dcdb97b0864465455032f187770abe36eb0..f64373d3ab3f9e7dd3baad6b26e1586a1ba6d54f 100644 (file)
@@ -625,6 +625,11 @@ WHERE mytable.myid = myothertable.otherid) AS t2view WHERE t2view.mytable_myid =
             select(["column1 AS foobar", "column2 AS hoho", table1.c.myid], from_obj=[table1]).select(),
             "SELECT column1 AS foobar, column2 AS hoho, myid FROM (SELECT column1 AS foobar, column2 AS hoho, mytable.myid AS myid FROM mytable)"
         )
+        
+        self.assert_compile(
+            select(['col1','col2'], from_obj='tablename').alias('myalias'),
+            "SELECT col1, col2 FROM tablename"
+        )
 
     def test_binds_in_text(self):
         self.assert_compile(