관리-도구
편집 파일: dependency.cpython-37.pyc
B ��4]ܵ � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ d dlmZ d dlm Z d dlmZ G dd � d e�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zeee ee eiZdS )zRelationship dependencies. � )� attributes)�exc)�sync)� unitofwork)�util)� MANYTOMANY)� MANYTOONE)� ONETOMANY� )�sqlc @ s� e Zd Zdd� Zedd� �Zdd� Zdd� Zd d � Zdd� Z d d� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zd%dd�Zd d!� Zd"d#� Zd$S )&�DependencyProcessorc C s� || _ |j| _|j| _|j| _|j| _|j| _|j| _|j| _|j| _|j | _ | jr^t j| _nt j | _| jrvt j| _nt j | _|j| _| j js�t�d| j ��d S )Nz|Can't build a DependencyProcessor for relationship %s. No target attributes to populate between parent and child are present)�prop�cascade�mapper�parent� secondary� direction�post_update�passive_deletes�passive_updates�enable_typechecksr �PASSIVE_NO_INITIALIZE�_passive_delete_flag�PASSIVE_OFF�_passive_update_flag�key�synchronize_pairs�sa_exc� ArgumentError)�selfr � r �L/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/dependency.py�__init__ s* zDependencyProcessor.__init__c C s t |j |�S )N)�_direction_to_processorr )�clsr r r r! �from_relationship6 s z%DependencyProcessor.from_relationshipc C s | j j�| j��|�S )z�return True if the given object instance has a parent, according to the ``InstrumentedAttribute`` handled by this ``DependencyProcessor``. )r Z class_manager�get_implr � hasparent)r �stater r r! r'