diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-18 02:38:11 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-18 02:38:11 +0000 |
| commit | 3d5a852b1d1300310f8db47a000305bf55a28e0e (patch) | |
| tree | a223df7d430fa574ae5298febbfa1ecf1ff3a497 /lib | |
| parent | c35a7171407568025c49257ea276b32eaf205dba (diff) | |
| download | sqlalchemy-3d5a852b1d1300310f8db47a000305bf55a28e0e.tar.gz | |
mapper double checks that columns in _compile_property are in the _cols_by_table collection
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 15fab0816..55dcabd32 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -649,11 +649,18 @@ class Mapper(object): # columns (included in zblog tests) if col is None: col = prop.columns[0] + else: + # if column is coming in after _cols_by_table was initialized, ensure the col is in the + # right set + if hasattr(self, '_cols_by_table') and col.table in self._cols_by_table and col not in self._cols_by_table[col.table]: + self._cols_by_table[col.table].add(col) self.columns[key] = col for col in prop.columns: for col in col.proxy_set: self._columntoproperty[col] = prop + + elif isinstance(prop, SynonymProperty) and setparent: if prop.instrument is None: prop.instrument = getattr(self.class_, key, None) |
