diff options
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/sql.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 76cc41289..92b186012 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -407,6 +407,9 @@ class Mapper(object): # may be a join or other construct self.tables = sqlutil.TableFinder(self.mapped_table) + if not len(self.tables): + raise exceptions.InvalidRequestError("Could not find any Table objects in mapped table '%s'" % str(self.mapped_table)) + # determine primary key columns self.pks_by_table = {} diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 01588e92d..ff92f0b43 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -3146,7 +3146,7 @@ class Select(_SelectBaseMixin, FromClause): def get_children(self, column_collections=True, **kwargs): return (column_collections and list(self.columns) or []) + \ - list(self._froms) + \ + list(self.locate_all_froms()) + \ [x for x in (self._whereclause, self._having, self._order_by_clause, self._group_by_clause) if x is not None] def _recorrelate_froms(self, froms): |