summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-11-07 00:52:49 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-11-07 00:52:49 +0000
commite09fed05c706b585b09749a8ff1bc87776b73ab5 (patch)
tree0b82cc3207b54f4c1f39cb8c34439f475b09feff /lib/sqlalchemy
parent7cd2c7d29934f1a6d215e7ea333687909866b00f (diff)
downloadsqlalchemy-e09fed05c706b585b09749a8ff1bc87776b73ab5.tar.gz
- fixed very hard-to-reproduce issue where by the FROM clause of Query
could get polluted by certain generative calls [ticket:852]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/query.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 2029dd3be..c8a1f9cf8 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -770,12 +770,6 @@ class Query(object):
context = QueryContext(self)
from_obj = self._from_obj
- alltables = []
- for l in [sql_util.TableFinder(x) for x in from_obj]:
- alltables += l
-
- if self.table not in alltables:
- from_obj.append(self.table)
if self._nestable(**self._select_args()):
s = sql.select([self.table], whereclause, from_obj=from_obj, **self._select_args()).alias('getcount').count()
else:
@@ -833,13 +827,6 @@ class Query(object):
if self.select_mapper.single and self.select_mapper.polymorphic_on is not None and self.select_mapper.polymorphic_identity is not None:
whereclause = sql.and_(whereclause, self.select_mapper.polymorphic_on.in_(*[m.polymorphic_identity for m in self.select_mapper.polymorphic_iterator()]))
- alltables = []
- for l in [sql_util.TableFinder(x) for x in from_obj]:
- alltables += l
-
- if self.table not in alltables:
- from_obj.append(self.table)
-
context.from_clauses = from_obj
# give all the attached properties a chance to modify the query