From: Mike Bayer Date: Fri, 17 Feb 2006 18:29:26 +0000 (+0000) Subject: added an assertion to insure that a column is only attached to one table X-Git-Tag: rel_0_1_1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d18d39b1456dff740806a9f2ae6451c3eb52138c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added an assertion to insure that a column is only attached to one table --- diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 8e85fb310b..bb926053d6 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -271,6 +271,8 @@ class Column(SchemaItem): self.table.primary_key.append(self) def _set_parent(self, table): + if getattr(self, 'table', None) is not None: + raise "this Column already has a table!" if not self.hidden: table.columns[self.key] = self if self.primary_key: