"""
@_memoized_configured_property
- def _propkey_to_col(self):
+ def _insert_cols_as_none(self):
return dict(
(
table,
- dict(
- (self._columntoproperty[col].key, col)
- for col in columns
- )
+ frozenset(
+ col.key for col in columns
+ if not col.primary_key and
+ not col.server_default and not col.default)
)
for table, columns in self._cols_by_table.items()
)
@_memoized_configured_property
- def _col_to_propkey(self):
+ def _propkey_to_col(self):
return dict(
(
table,
- [
- (col, self._columntoproperty[col].key)
+ dict(
+ (self._columntoproperty[col].key, col)
for col in columns
- ]
+ )
)
for table, columns in self._cols_by_table.items()
)
else:
params[col.key] = value
- for colkey in (
- set(
- col.key for col in
- mapper._cols_by_table[table]
- if not col.primary_key and
- not col.server_default and not col.default
- ).difference(params).difference(value_params)
- ):
+ for colkey in mapper._insert_cols_as_none[table].\
+ difference(params).difference(value_params):
params[colkey] = None
has_all_pks = mapper._pk_keys_by_table[table].issubset(params)