diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-09-04 17:44:48 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-09-04 17:44:48 +0000 |
| commit | 94c32b19a08182aa5403a893ffd037994199ca44 (patch) | |
| tree | 15e08f101e7292cbf4a636bccbeea97f28f74bcd /lib/sqlalchemy/orm | |
| parent | cd8a3390e6992a1a969af47ee6268456d7890aa8 (diff) | |
| download | sqlalchemy-94c32b19a08182aa5403a893ffd037994199ca44.tar.gz | |
- Fixed bug whereby mapper couldn't initialize if a composite
primary key referenced another table that was not defined
yet [ticket:1161]
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index cfea61e26..d6dbc2634 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -545,11 +545,11 @@ class Mapper(object): # determine primary key from argument or mapped_table pks - reduce to the minimal set of columns if self.primary_key_argument: primary_key = sqlutil.reduce_columns( - self.mapped_table.corresponding_column(c) - for c in self.primary_key_argument) + [self.mapped_table.corresponding_column(c) for c in self.primary_key_argument], + ignore_nonexistent_tables=True) else: primary_key = sqlutil.reduce_columns( - self._pks_by_table[self.mapped_table]) + self._pks_by_table[self.mapped_table], ignore_nonexistent_tables=True) if len(primary_key) == 0: raise sa_exc.ArgumentError("Mapper %s could not assemble any primary key columns for mapped table '%s'" % (self, self.mapped_table.description)) |
