From ad231da3b83bcdad4446690fa37fbe03408a40d6 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 1 Apr 2008 17:13:09 +0000 Subject: - merge() may actually work now, though we've heard that before... - merge() uses the priamry key attributes on the object if _instance_key not present. so merging works for instances that dont have an instnace_key, will still issue UPDATE for existing rows. - improved collection behavior for merge() - will remove elements from a destination collection that are not in the source. - fixed naive set-mutation issue in Select._get_display_froms - simplified fixtures.Base a bit --- lib/sqlalchemy/sql/expression.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/sql/expression.py') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 2cd10720a..758f75ebe 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -3096,9 +3096,9 @@ class Select(_SelectBaseMixin, FromClause): if self._froms: froms.update(self._froms) - - for f in froms: - froms.difference_update(f._hide_froms) + + toremove = itertools.chain(*[f._hide_froms for f in froms]) + froms.difference_update(toremove) if len(froms) > 1 or self.__correlate: if self.__correlate: -- cgit v1.2.1