(state, item, initiator, **kw)
| 47 | key = prop.key |
| 48 | |
| 49 | def append(state, item, initiator, **kw): |
| 50 | # process "save_update" cascade rules for when |
| 51 | # an instance is appended to the list of another instance |
| 52 | |
| 53 | if item is None: |
| 54 | return |
| 55 | |
| 56 | sess = state.session |
| 57 | if sess: |
| 58 | if sess._warn_on_events: |
| 59 | sess._flush_warning("collection append") |
| 60 | |
| 61 | prop = state.manager.mapper._props[key] |
| 62 | item_state = attributes.instance_state(item) |
| 63 | |
| 64 | if ( |
| 65 | prop._cascade.save_update |
| 66 | and (key == initiator.key) |
| 67 | and not sess._contains_state(item_state) |
| 68 | ): |
| 69 | sess._save_or_update_state(item_state) |
| 70 | return item |
| 71 | |
| 72 | def remove(state, item, initiator, **kw): |
| 73 | if item is None: |
nothing calls this directly
no test coverage detected