%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/__pycache__/base.cpython-37.pyc

B

��4]:�@s dZddlZddlmZddlmZddlmZddlmZddlmZe�	d	d
�Z
e�	dd�Ze�	d
d�Ze�	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-eeBeBeBeBd�Zej	d.d/eeAd�Zej	d0d1eeAd�Zej	d2d3eeAd�Zej	d4d5eeAd�Zej	d6d7eeAd�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�ZGGdrds�dse:�ZHGdtdu�dueH�ZIGdvdw�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
    )Z	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)�mapperZinstrumentor�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_STATEcstj�fdd��}|S)z1Mark a method as generative, e.g. method-chained.csB|d��}x�D]}|||j�qW||f|dd��|�|S)Nrr)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)rZ	decorator)r/r2r0)r/r1�_generative�sr3cCs|j�td�S)N)�__dict__�get�DEFAULT_MANAGER_ATTR)�clsr0r0r1�manager_of_class�sr8r4cCstt|��S)z'Return a string describing an instance.)�	state_str�instance_state)�instancer0r0r1�instance_str�sr<cCs(|dkrdSd|jjt|���fSdS)z=Return a string describing an instance via its InstanceState.N�Nonez<%s at 0x%x>)�class_r*�id�obj)�stater0r0r1r9�sr9cCs|dkrdSd|jjfSdS)zNReturn a string describing an instance's class via its
    InstanceState.
    Nr=z<%s>)r>r*)rAr0r0r1�state_class_str�srBcCst|�d|S)N�.)r<)r;�	attributer0r0r1�
attribute_strsrEcCst|�d|S)NrC)r9)rArDr0r0r1�state_attribute_strsrFcCs
t|�jS)a�Given an object, return the primary Mapper associated with the object
    instance.

    Raises :class:`sqlalchemy.orm.exc.UnmappedInstanceError`
    if no mapping is configured.

    This function is available via the inspection system as::

        inspect(instance).mapper

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the instance is
    not part of a mapping.

    )�object_stater")r;r0r0r1�
object_mappersrHcCs$t|�}|dkrt�|��n|SdS)a�Given an object, return the :class:`.InstanceState`
    associated with the object.

    Raises :class:`sqlalchemy.orm.exc.UnmappedInstanceError`
    if no mapping is configured.

    Equivalent functionality is available via the :func:`.inspect`
    function as::

        inspect(instance)

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the instance is
    not part of a mapping.

    N)�_inspect_mapped_objectrZUnmappedInstanceError)r;rAr0r0r1rG"srGcCs8yt|�Stjk
rdStjk
r2dSXdS)N)r:r�UnmappedClassError�NO_STATE)r;r0r0r1rI:srIcCs(t�|d�}|dk	r|jSt�|��dS)NF)r�inspectr"rrJ)Zclass_or_mapper�inspr0r0r1�_class_to_mapperFsrNcCs"t�|d�}|dk	r|jSdSdS)z\Return the :class:`.Mapper` for the given class or None if the
    class is not mapped.
    FN)rrLr")�entityrMr0r0r1�_mapper_or_noneNsrPcCs(t�|d�}|dk	o&|jo&|jp&|jS)zhReturn True if the given object is a mapped class,
    :class:`.Mapper`, or :class:`.AliasedClass`.
    FN)rrL�is_clause_element�	is_mapper�is_aliased_class)rOrMr0r0r1�_is_mapped_classZsrTcCst|d�r|jSt�|�SdS)N�key)�hasattrrUrZ_column_as_key)�attrr0r0r1�_attr_as_keygs
rXcCs>t�|d�}t|d�r4t|jd�r4dd�|jjD�S|gSdS)NF�
selectable�ccSsg|]}|�qSr0r0)�.0rZr0r0r1�
<listcomp>qsz _orm_columns.<locals>.<listcomp>)rrLrVrYrZ)rOrMr0r0r1�_orm_columnsnsr]cCs t�|d�}|dk	ot|dd�S)NFrS)rrL�getattr)rOrMr0r0r1�_is_aliased_classvsr_cCs�t�|�}|jr|}|j}n.|jr.|j}|}nt|d�rF|jj}}n|}y
t	||�St
k
rzt�d||f��YnXdS)z�Return a class attribute given an entity and string name.

    May return :class:`.InstrumentedAttribute` or user-defined
    attribute.

    r"z Entity '%s' has no property '%s'N)
rrL�
is_selectablerZrSrOrVr"r>r^�AttributeError�sa_excZInvalidRequestError)rOrUrM�descriptionr0r0r1�_entity_descriptor{s


rdzmanager.mapperFcCsNyt|�}|jsdS|j}Wntjk
r2dSX|rF|jrF|��|SdS)N)r8Z	is_mappedr"rrKZ_new_mappersZ_configure_all)r>�	configureZ
class_managerr"r0r0r1�_inspect_mapped_class�s

rfTcCsBt||d�}|dkr:t|t�s.t�d|f��t�|��n|SdS)a�Given a class, return the primary :class:`.Mapper` associated
    with the key.

    Raises :exc:`.UnmappedClassError` if no mapping is configured
    on the given class, or :exc:`.ArgumentError` if a non-class
    object is passed.

    Equivalent functionality is available via the :func:`.inspect`
    function as::

        inspect(some_mapped_class)

    Using the inspection system will raise
    :class:`sqlalchemy.exc.NoInspectionAvailable` if the class is not mapped.

    )reNz Class object expected, got '%r'.)rf�
isinstance�typerbZ
ArgumentErrorrrJ)r>rer"r0r0r1�class_mapper�s
ric@s8eZdZdZdZdZdZdZdZdZ	dZ
dZdZe
ZdS)�InspectionAttra A base class applied to all ORM objects that can be returned
    by the :func:`.inspect` function.

    The attributes defined here allow the usage of simple boolean
    checks to test basic facts about the object returned.

    While the boolean checks here are basically the same as using
    the Python isinstance() function, the flags here can be used without
    the need to import all of these classes, and also such that
    the SQLAlchemy class system can change while leaving the flags
    here intact for forwards-compatibility.

    r0FN)r*�
__module__�__qualname__�__doc__�	__slots__r`rSZis_instancerRZis_propertyZis_attributeZ_is_internal_proxyrQr)Zextension_typer0r0r0r1rj�s
rjc@seZdZdZejdd��ZdS)�InspectionAttrInfoaAdds the ``.info`` attribute to :class:`.InspectionAttr`.

    The rationale for :class:`.InspectionAttr` vs. :class:`.InspectionAttrInfo`
    is that the former is compatible as a mixin for classes that specify
    ``__slots__``; this is essentially an implementation artifact.

    cCsiS)a�Info dictionary associated with the object, allowing user-defined
        data to be associated with this :class:`.InspectionAttr`.

        The dictionary is generated when first accessed.  Alternatively,
        it can be specified as a constructor argument to the
        :func:`.column_property`, :func:`.relationship`, or :func:`.composite`
        functions.

        .. versionchanged:: 1.0.0 :attr:`.MapperProperty.info` is also
           available on extension types via the
           :attr:`.InspectionAttrInfo.info` attribute, so that it can apply
           to a wider variety of ORM and extension constructs.

        .. seealso::

            :attr:`.QueryableAttribute.info`

            :attr:`.SchemaItem.info`

        r0)r.r0r0r1�infoszInspectionAttrInfo.infoN)r*rkrlrmrZmemoized_propertyrpr0r0r0r1ro
sroc@seZdZdZdZdS)�_MappedAttributezVMixin for attributes which should be replaced by mapper-assigned
    attributes.

    r0N)r*rkrlrmrnr0r0r0r1rq/srq)F)T)Krm�operator�rrbrrZsqlrZsymbolrr	r
rrr
rrrrrrrrrrrrr r!r6ZDEFAULT_STATE_ATTRZ
_INSTRUMENTORr#r$r%r&r'r(r)�	frozensetZ
_never_setZ	_none_setZ_SET_DEFERRED_EXPIREDZ_DEFER_FOR_STATEr3r8�
attrgetterr:Z
instance_dictr<r9rBrErFrHrGZ	_inspects�objectrIrNrPrTrXr]r_rdZdottedgetterZ
_state_mapperrhrfrirjrorqr0r0r0r1�<module>
s�







	


I"

Zerion Mini Shell 1.0