OwlCyberSecurity - MANAGER
Edit File: unitofwork.cpython-312.pyc
� ̓�g�i � �� � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd l m Z dd l mZ ddl m Z dd l mZ ddl m Z ddl mZ er$ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ d� Z G d� d� Z G d� d� Z G d� de� Z G d� d� Z G d� dee � Z! G d � d!e � Z" G d"� d#e � Z# G d$� d%e � Z$ G d&� d'e � Z% G d(� d)e � Z& G d*� d+e � Z'y,)-z�The internals for the unit of work system. The session's flush() process passes objects to a contextual object here, which assembles flush tasks based on mappers and their properties, organizes them in order of dependency, and executes. � )�annotations)�Any)�Dict)�Optional)�Set)� TYPE_CHECKING� �� attributes)�exc)�util� )�event)�topological)�DependencyProcessor)�MapperProperty)�Mapper)�Session)�SessionTransaction)� InstanceStatec � �� |j ��fd�}�fd�}�fd�}t j | d|dd�� t j | d|ddd�� t j | d |ddd�� t j | d |ddd�� y)z\Establish event listeners on object attributes which handle cascade-on-set/append. c �b �� |�y | j }|r�|j r|j d� | j j j � }t j |� }|j j r1�|j k( r"|j |� s|j |� |S )Nzcollection append) �session�_warn_on_events�_flush_warning�manager�mapper�_propsr �instance_state�_cascade�save_update�key�_contains_state�_save_or_update_state��state�item� initiator�kw�sess�prop� item_stater"