From 9bb80a8f11d73c8c30c5c44ef33b05ec2c8d2d20 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 31 Oct 2006 00:51:16 +0000 Subject: figured out how a Select can be in its own _froms list, changed assertion to just a continue --- lib/sqlalchemy/sql.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql.py') 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 -- cgit v1.2.1