(
source,
source_mapper,
dest,
dest_mapper,
synchronize_pairs,
uowcommit,
flag_cascaded_pks,
)
| 20 | |
| 21 | |
| 22 | def _populate( |
| 23 | source, |
| 24 | source_mapper, |
| 25 | dest, |
| 26 | dest_mapper, |
| 27 | synchronize_pairs, |
| 28 | uowcommit, |
| 29 | flag_cascaded_pks, |
| 30 | ): |
| 31 | source_dict = source.dict |
| 32 | dest_dict = dest.dict |
| 33 | |
| 34 | for l, r in synchronize_pairs: |
| 35 | try: |
| 36 | # inline of source_mapper._get_state_attr_by_column |
| 37 | prop = source_mapper._columntoproperty[l] |
| 38 | value = source.manager[prop.key].impl.get( |
| 39 | source, source_dict, PassiveFlag.PASSIVE_OFF |
| 40 | ) |
| 41 | except exc.UnmappedColumnError as err: |
| 42 | _raise_col_to_prop(False, source_mapper, l, dest_mapper, r, err) |
| 43 | |
| 44 | try: |
| 45 | # inline of dest_mapper._set_state_attr_by_column |
| 46 | prop = dest_mapper._columntoproperty[r] |
| 47 | dest.manager[prop.key].impl.set(dest, dest_dict, value, None) |
| 48 | except exc.UnmappedColumnError as err: |
| 49 | _raise_col_to_prop(True, source_mapper, l, dest_mapper, r, err) |
| 50 | |
| 51 | # technically the "r.primary_key" check isn't |
| 52 | # needed here, but we check for this condition to limit |
| 53 | # how often this logic is invoked for memory/performance |
| 54 | # reasons, since we only need this info for a primary key |
| 55 | # destination. |
| 56 | if ( |
| 57 | flag_cascaded_pks |
| 58 | and l.primary_key |
| 59 | and r.primary_key |
| 60 | and r.references(l) |
| 61 | ): |
| 62 | uowcommit.attributes[("pk_cascaded", dest, r)] = True |
| 63 | |
| 64 | |
| 65 | def _bulk_populate_inherit_keys(source_dict, source_mapper, synchronize_pairs): |
nothing calls this directly
no test coverage detected