From c2f86c92b1fbb4e855161bd509d3057f86ed7a74 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 27 Feb 2014 13:50:47 -0500 Subject: restore the contracts of update/extend to the degree that the same column identity isn't appended to the list. reflection makes use of this. --- lib/sqlalchemy/sql/base.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/sql/base.py') diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index c2bdd8b1c..379f61ed7 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -522,17 +522,19 @@ class ColumnCollection(util.OrderedProperties): raise NotImplementedError() def remove(self, column): - raise NotImplementedError() + del self._data[column.key] + self._all_col_set.remove(column) + self._all_columns[:] = [c for c in self._all_columns if c is not column] def update(self, iter): cols = list(iter) - self._all_columns.extend(c for label, c in cols) + self._all_columns.extend(c for label, c in cols if c not in self._all_col_set) self._all_col_set.update(c for label, c in cols) self._data.update((label, c) for label, c in cols) def extend(self, iter): cols = list(iter) - self._all_columns.extend(cols) + self._all_columns.extend(c for c in cols if c not in self._all_col_set) self._all_col_set.update(cols) self._data.update((c.key, c) for c in cols) -- cgit v1.2.1