(self, deplist, uowcommit)
| 942 | return switched |
| 943 | |
| 944 | def _process_key_switches(self, deplist, uowcommit): |
| 945 | switchers = self._key_switchers(uowcommit, deplist) |
| 946 | if switchers: |
| 947 | # if primary key values have actually changed somewhere, perform |
| 948 | # a linear search through the UOW in search of a parent. |
| 949 | for state in uowcommit.session.identity_map.all_states(): |
| 950 | if not issubclass(state.class_, self.parent.class_): |
| 951 | continue |
| 952 | dict_ = state.dict |
| 953 | related = state.get_impl(self.key).get( |
| 954 | state, dict_, passive=self._passive_update_flag |
| 955 | ) |
| 956 | if ( |
| 957 | related is not attributes.PASSIVE_NO_RESULT |
| 958 | and related is not None |
| 959 | ): |
| 960 | if self.prop.uselist: |
| 961 | if not related: |
| 962 | continue |
| 963 | related_obj = related[0] |
| 964 | else: |
| 965 | related_obj = related |
| 966 | related_state = attributes.instance_state(related_obj) |
| 967 | if related_state in switchers: |
| 968 | uowcommit.register_object( |
| 969 | state, False, self.passive_updates |
| 970 | ) |
| 971 | sync._populate( |
| 972 | related_state, |
| 973 | self.mapper, |
| 974 | state, |
| 975 | self.parent, |
| 976 | self.prop.synchronize_pairs, |
| 977 | uowcommit, |
| 978 | self.passive_updates, |
| 979 | ) |
| 980 | |
| 981 | def _pks_changed(self, uowcommit, state): |
| 982 | return bool(state.key) and sync._source_modified( |
no test coverage detected