diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-07 01:36:16 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-11-07 01:36:16 +0000 |
| commit | c1a9a96ba541c8ec12864259dd2f076ef6e056c8 (patch) | |
| tree | 8c3568d1d61aad6d664144859d4fecd9a1cd9965 /lib/sqlalchemy/orm/sync.py | |
| parent | e09fed05c706b585b09749a8ff1bc87776b73ab5 (diff) | |
| download | sqlalchemy-c1a9a96ba541c8ec12864259dd2f076ef6e056c8.tar.gz | |
adjusted "blank out primary key" rule to check for "allow_null_pks" on target mapper. this was revealed by
recent attributes.py change in r3695 that causes a value of "None" to register as part of the attribute history's
added_items() collection (i.e. since AttributeHistory compares against NO_VALUE instead of None).
Diffstat (limited to 'lib/sqlalchemy/orm/sync.py')
| -rw-r--r-- | lib/sqlalchemy/orm/sync.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/sync.py b/lib/sqlalchemy/orm/sync.py index d85842861..5b5a9e43b 100644 --- a/lib/sqlalchemy/orm/sync.py +++ b/lib/sqlalchemy/orm/sync.py @@ -118,7 +118,7 @@ class SyncRule(object): try: return self._dest_primary_key except AttributeError: - self._dest_primary_key = self.dest_mapper is not None and self.dest_column in self.dest_mapper.pks_by_table[self.dest_column.table] + self._dest_primary_key = self.dest_mapper is not None and self.dest_column in self.dest_mapper.pks_by_table[self.dest_column.table] and not self.dest_mapper.allow_null_pks return self._dest_primary_key def execute(self, source, dest, obj, child, clearkeys): |
