diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-19 23:46:14 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-02-19 23:46:14 +0000 |
| commit | 7f43bc55e027b6419ac5a9893515ad9581c98538 (patch) | |
| tree | 3ea6904cc8db7dcab2b6928029ae1740e90be7ac | |
| parent | 3e6e61dbe7b13be851e78db4280565f84c874c35 (diff) | |
| download | sqlalchemy-7f43bc55e027b6419ac5a9893515ad9581c98538.tar.gz | |
- can again create aliases of selects against textual
FROM clauses, [ticket:975]
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/expression.py | 1 | ||||
| -rw-r--r-- | test/sql/select.py | 5 |
3 files changed, 10 insertions, 0 deletions
@@ -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 diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index b39e406da..e39487c54 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -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. diff --git a/test/sql/select.py b/test/sql/select.py index 39906dcdb..f64373d3a 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -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( |
