diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-31 00:51:16 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-10-31 00:51:16 +0000 |
commit | 9bb80a8f11d73c8c30c5c44ef33b05ec2c8d2d20 (patch) | |
tree | 5757702aaf95a7203a93edbad197d2dee65c6ba8 /lib/sqlalchemy/sql.py | |
parent | b2c68fab83092eb760e07c63c64274bf59f46f54 (diff) | |
download | sqlalchemy-9bb80a8f11d73c8c30c5c44ef33b05ec2c8d2d20.tar.gz |
figured out how a Select can be in its own _froms list, changed assertion to just a continue
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 61b3d277a..ce33810a5 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -1455,6 +1455,7 @@ class Select(_SelectBaseMixin, FromClause): self._correlator = Select._CorrelatedVisitor(self, False) self._wherecorrelator = Select._CorrelatedVisitor(self, True) + self.group_by(*(group_by or [None])) self.order_by(*(order_by or [None])) @@ -1543,8 +1544,9 @@ class Select(_SelectBaseMixin, FromClause): def _locate_oid_column(self): for f in self._froms.values(): if f is self: - # TODO: why would we be in our own _froms list ? - raise exceptions.AssertionError("Select statement should not be in its own _froms list") + # we might be in our own _froms list if a column with us as the parent is attached, + # which includes textual columns. + continue oid = f.oid_column if oid is not None: return oid |