/
opt
/
alt
/
python27
/
lib64
/
python2.7
/
site-packages
/
sqlalchemy
/
orm
/
up file
home
� 1��fc @ sC d Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ i e e 6e e 6e e 6Z d S( s Relationship dependencies. i ( t attributes( t exc( t sync( t unitofwork( t util( t MANYTOMANY( t MANYTOONE( t ONETOMANYi ( t sqlt DependencyProcessorc B s� e Z d � Z e d � � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d � Z d � Z d � Z RS( c C s | | _ | j | _ | j | _ | j | _ | j | _ | j | _ | j | _ | j | _ | j | _ | j | _ | j r� t j | _ n t j | _ | j r� t j | _ n t j | _ d | j j | j f | _ | j | _ | j j s t j d | j � � n d S( Ns %s_%ss| Can't build a DependencyProcessor for relationship %s. No target attributes to populate between parent and child are present( t propt cascadet mappert parentt secondaryt directiont post_updatet passive_deletest passive_updatest enable_typechecksR t PASSIVE_NO_INITIALIZEt _passive_delete_flagt PASSIVE_OFFt _passive_update_flagt _sort_keyt keyt sort_keyt synchronize_pairst sa_exct ArgumentError( t selfR ( ( sL /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/dependency.pyt __init__ s, c C s t | j | � S( N( t _direction_to_processorR ( t clsR ( ( sL /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/dependency.pyt from_relationship7 s c C s | j j j | j � j | � S( s� return True if the given object instance has a parent, according to the ``InstrumentedAttribute`` handled by this ``DependencyProcessor``. ( R t class_managert get_implR t hasparent( R t state( ( sL /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/dependency.pyR% ; s c C s | j | t � d S( s� establish actions and dependencies related to a flush. These actions will operate on all relevant states in the aggregate. N( t register_preprocessort True( R t uow( ( sL /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/dependency.pyt per_property_preprocessorsC s c C s� t j | | t t � } t j | | t t � } t j | | j j � } t j | | j j � } t j | | j j � } t j | | j j � } | j | | | | | | | � d S( N( R t ProcessAllt FalseR( t SaveUpdateAllR t primary_base_mapperR t DeleteAllt per_property_dependencies( R R) t after_savet before_deletet parent_savest child_savest parent_deletest child_deletes( ( sL /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/dependency.pyt per_property_flush_actionsL s$ c C s� | j j } t j | | � } t j | | � } | rZ t j | | t t � } t | _ n! t j | | t t � } t | _ | | j k r� | | j k s� t � | t f | t f g } t } n t } | s t j | | j j � } d } } | | j k rCt } qCn: t j | | j j � } d } } | | j k rCt } n x�| D]�} | j | j j j | | j | r{| j n t j � } | s�qJn | r�t j | | t | � } | rt j | | � } qn3 t j | | t | � } | rt j | | � } n | r�g } x� | D]} \ } } | | j k r9d } nL | j | \ } } | rmt j | | � t f } n t j | | � t f } | j | � qWn x6 | D]. \ } } | j | | | | | | | | � q�WqJWd S( s� establish actions and dependencies related to a flush. These actions will operate on all relevant states individually. This occurs only if there are cycles in the 'aggregated' version of events. N( NN( R R. R R- R/ R+ R( t disabledR, t cyclest AssertionErrorR t base_mappert Nonet managerR t implt get_all_pendingt dictR R R t ProcessStatet DeleteStatet SaveUpdateStatet statest appendt per_state_dependencies( R R) RD t isdeletet child_base_mapperR4 R6 R2 R1 t child_actionst child_in_cyclesR3 R5 t parent_in_cyclesR&