관리-도구
편집 파일: base.cpython-37.pyc
B ��4]: � @ s d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e� d d �Z e� dd�Ze� d d�Ze� dd�Z e� dd�Zej dddd�Zej dddd�Zej dddd�Zej dddd�Zej dddd�Zej d d!d"d�Zej d#d$d%d�Zej d&d'd(d�Zej d)d*d+d�Zej d,d-eeB eB eB eB d�Zej d.d/eeA d�Zej d0d1eeA d�Zej d2d3eeA d�Zej d4d5eeA d�Zej d6d7eeA d�Zd8Zd9Zd:Z e� d;�Z!e� d<�Z"e� d=�Z#e� d>d?�Z$e� d@dA�Z%e� dBdC�Z&e� dDdE�Z'e(eg�Z)e(dee g�Z*e� dF�Z+e� dG�Z,dHdI� Z-dJdK� Z.e�/e�Z0e�/dL�Z1dMdN� Z2dOdP� Z3dQdR� Z4dSdT� Z5dUdV� Z6dWdX� Z7dYdZ� Z8e�9e:�d[d\� �Z;d]d^� Z<d_d`� Z=dadb� Z>dcdd� Z?dedf� Z@dgdh� ZAdidj� ZBe�Cdk�ZDe�9eE�dxdmdn��ZFdydpdq�ZGG drds� dse:�ZHG dtdu� dueH�ZIG dvdw� dwe:�ZJdS )zz=Constants and rudimental functions used throughout the ORM. � N� )�exc� )� inspection)�util)� expression�PASSIVE_NO_RESULTz�Symbol returned by a loader callable or other attribute/history retrieval operation when a value could not be determined, based on loader callable flags. �ATTR_WAS_SETz�Symbol returned by a loader callable to indicate the retrieved value, or values, were assigned to their attributes on the target object. � ATTR_EMPTYz@Symbol used internally to indicate an attribute had no callable.�NO_VALUEz�Symbol which may be placed as the 'previous' value of an attribute, indicating no value was loaded for an attribute when it was modified, and flags indicated we were not to load it. � NEVER_SETz�Symbol which may be placed as the 'previous' value of an attribute indicating that the attribute had not been assigned to previously. � NO_CHANGEz]No callables or SQL should be emitted on attribute access and no state should change )� canonical�CALLABLES_OKzELoader callables can be fired off if a value is not present. �SQL_OKzBLoader callables can emit SQL at least on scalar value attributes.�RELATED_OBJECT_OKzZCallables can use SQL to load related objects as well as scalar value attributes. � �INIT_OKz�Attributes should be initialized with a blank value (None or an empty collection) upon get, if no other value can be obtained. � �NON_PERSISTENT_OKz9Callables can be emitted if the parent is not persistent.� �LOAD_AGAINST_COMMITTEDzUCallables should use committed values as primary/foreign keys during a load. � �NO_AUTOFLUSHz*Loader callables should disable autoflush.�@ �NO_RAISEz0Loader callables should not raise any assertions� �PASSIVE_OFFz&Callables can be emitted in all cases.�PASSIVE_RETURN_NEVER_SETzPASSIVE_OFF ^ INIT_OK�PASSIVE_NO_INITIALIZEz'PASSIVE_RETURN_NEVER_SET ^ CALLABLES_OK�PASSIVE_NO_FETCHzPASSIVE_OFF ^ SQL_OK�PASSIVE_NO_FETCH_RELATEDzPASSIVE_OFF ^ RELATED_OBJECT_OK�PASSIVE_ONLY_PERSISTENTzPASSIVE_OFF ^ NON_PERSISTENT_OKZ_sa_class_managerZ_sa_instance_state)�mapperZinstrumentor�EXT_CONTINUE�EXT_STOP�EXT_SKIP� ONETOMANYz�Indicates the one-to-many direction for a :func:`.relationship`. This symbol is typically used by the internals but may be exposed within certain API features. � MANYTOONEz�Indicates the many-to-one direction for a :func:`.relationship`. This symbol is typically used by the internals but may be exposed within certain API features. � MANYTOMANYz�Indicates the many-to-many direction for a :func:`.relationship`. This symbol is typically used by the internals but may be exposed within certain API features. � NOT_EXTENSIONz�Symbol indicating an :class:`InspectionAttr` that's not part of sqlalchemy.ext. Is assigned to the :attr:`.InspectionAttr.extension_type` attribute. ZSET_DEFERRED_EXPIREDZDEFER_FOR_STATEc s t j� fdd��}|S )z1Mark a method as generative, e.g. method-chained.c sB |d � � }x� D ]}||| j� qW | |f|dd � �|� |S )Nr r )Z_clone�__name__)�fn�args�kw�selfZ assertion)� assertions� �F/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/base.py�generate� s z_generative.<locals>.generate)r � decorator)r0 r3 r1 )r0 r2 �_generative� s r5 c C s | j �td �S )N)�__dict__�get�DEFAULT_MANAGER_ATTR)�clsr1 r1 r2 �manager_of_class� s r: r6 c C s t t| ��S )z'Return a string describing an instance.)� state_str�instance_state)�instancer1 r1 r2 �instance_str� s r>