Issue ``DELETE`` statements for a list of objects. This is called within the context of a UOWTransaction during a flush operation.
(base_mapper, states, uowtransaction)
| 165 | |
| 166 | |
| 167 | def _delete_obj(base_mapper, states, uowtransaction): |
| 168 | """Issue ``DELETE`` statements for a list of objects. |
| 169 | |
| 170 | This is called within the context of a UOWTransaction during a |
| 171 | flush operation. |
| 172 | |
| 173 | """ |
| 174 | |
| 175 | states_to_delete = list( |
| 176 | _organize_states_for_delete(base_mapper, states, uowtransaction) |
| 177 | ) |
| 178 | |
| 179 | table_to_mapper = base_mapper._sorted_tables |
| 180 | |
| 181 | for table in reversed(list(table_to_mapper.keys())): |
| 182 | mapper = table_to_mapper[table] |
| 183 | if table not in mapper._pks_by_table: |
| 184 | continue |
| 185 | elif mapper.inherits and mapper.passive_deletes: |
| 186 | continue |
| 187 | |
| 188 | delete = _collect_delete_commands( |
| 189 | base_mapper, uowtransaction, table, states_to_delete |
| 190 | ) |
| 191 | |
| 192 | _emit_delete_statements( |
| 193 | base_mapper, |
| 194 | uowtransaction, |
| 195 | mapper, |
| 196 | table, |
| 197 | delete, |
| 198 | ) |
| 199 | |
| 200 | for ( |
| 201 | state, |
| 202 | state_dict, |
| 203 | mapper, |
| 204 | connection, |
| 205 | update_version_id, |
| 206 | ) in states_to_delete: |
| 207 | mapper.dispatch.after_delete(mapper, connection, state) |
| 208 | |
| 209 | |
| 210 | def _organize_states_for_save(base_mapper, states, uowtransaction): |
nothing calls this directly
no test coverage detected