Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/orm/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/orm/__pycache__/base.cpython-311.pyc

�

�܋f�;��t�dZddlZddlmZddlmZddlmZddlmZddlmZej	d	d
��Z
ej	dd��Zej	d
d��Zej	dd��Z
ej	dd��Zej	dd��Zej	ddd���Zej	ddd���Zej	ddd���Zej	ddd���Zej	dd d!���Zej	d"d#d$���Zej	d%d&d'���Zej	d(d)d*���Zej	d+d,d-���Zej	d.d/eezezezez���Zej	d0d1eez���Zej	d2d3eez���Zej	d4d5eez���Zej	d6d7eez���Zej	d8d9eez���Zd:Zd;Z d<Z!ej	d=��Z"ej	d>��Z#ej	d?��Z$ej	d@dA��Z%ej	dBdC��Z&ej	dDdE��Z'ej	dFdG��Z(e)eg��Z*e)dee
g��Z+ej	dH��Z,ej	dI��Z-dJ�Z.dK�Z/ej0e ��Z1ej0dL��Z2dM�Z3dN�Z4dO�Z5dP�Z6dQ�Z7dR�Z8dS�Z9ej:e;��dT���Z<dU�Z=dV�Z>dW�Z?dX�Z@dY�ZAdZ�ZBd[�ZCejDd\��ZEej:eF��dgd^���ZGdhd`�ZHGda�dbe;��ZIGdc�ddeI��ZJGde�dfe;��ZKdS)iz=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.
    �PASSIVE_CLASS_MISMATCHz�Symbol indicating that an object is locally present for a given
    primary key identity but it is not of the requested class.  The
    return value is therefore None and no SQL should be emitted.�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_OK�_sa_class_manager�_sa_instance_state)�mapper�instrumentor�EXT_CONTINUE�EXT_STOP�EXT_SKIP�	ONETOMANYz�Indicates the one-to-many direction for a :func:`_orm.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:`_orm.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:`_orm.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.

    �SET_DEFERRED_EXPIRED�DEFER_FOR_STATEc�6��tj�fd���}|S)z1Mark a method as generative, e.g. method-chained.c���|d���}�D]}|||j���||g|dd��Ri|��|S)Nrr)�_clone�__name__)�fn�args�kw�self�	assertion�
assertionss     ��J/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/orm/base.py�generatez_generative.<locals>.generate�si����A�w�~�~����#�	)�	)�I��I�d�B�K�(�(�(�(�
��4�!�$�q�r�r�(�!�!�!�b�!�!�!���)r�	decorator)r;r=s` r<�_generativer@�s1���
�^������^���Or>c�B�|j�td��S�N)�__dict__�get�DEFAULT_MANAGER_ATTR)�clss r<�manager_of_classrG�s���<���0�$�7�7�7r>rCc�:�tt|����S)z'Return a string describing an instance.)�	state_str�instance_state��instances r<�instance_strrM�s���^�H�-�-�.�.�.r>c�j�|�dSd|jjt|�����fzS)z=Return a string describing an instance via its InstanceState.N�Nonez<%s at 0x%x>)�class_r5�id�obj��states r<rIrI�s1��
�}��v����!6��5�9�9�;�;��� H�H�Hr>c�*�|�dSd|jj�d�S)zNReturn a string describing an instance's class via its
    InstanceState.
    NrO�<�>)rPr5rSs r<�state_class_strrXs)��

�}��v����.�.�.�0�0r>c�,�t|��dz|zS�N�.)rM)rL�	attributes  r<�
attribute_strr]s����!�!�C�'�)�3�3r>c�,�t|��dz|zSrZ)rI)rTr\s  r<�state_attribute_strr_s���U���c�!�I�-�-r>c�*�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'rKs r<�
object_mapperrbs�� ��!�!�(�(r>c�P�t|��}|�tj|���|S)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:`_sa.inspect`
    function as::

        inspect(instance)

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

    )�_inspect_mapped_objectr�UnmappedInstanceError)rLrTs  r<rara)s,��"
#�8�,�,�E��}��'��1�1�1��r>c�p�	t|��S#tj$rYdStj$rYdSwxYwrB)rJr�UnmappedClassError�NO_STATErKs r<rdrdAsW����h�'�'�'���!�����t�t��<�����t�t����s��5�5�5c�f�tj|d��}|�|jStj|���)NF)r�inspectr'rrg)�class_or_mapper�insps  r<�_class_to_mapperrmMs3����o�u�5�5�D����{���$�_�5�5�5r>c�B�tj|d��}|�|jSdS)z`Return the :class:`_orm.Mapper` for the given class or None if the
    class is not mapped.
    FN)rrjr'��entityrls  r<�_mapper_or_nonerqUs)��
��f�e�,�,�D����{���tr>c�`�tj|d��}|duo|jo
|jp|jS)zlReturn True if the given object is a mapped class,
    :class:`_orm.Mapper`, or :class:`.AliasedClass`.
    FN)rrj�is_clause_element�	is_mapper�is_aliased_classros  r<�_is_mapped_classrvasC��
��f�e�,�,�D��D��	6��&�&�	6�
�^�
4�t�4�r>c�X�t|d��r|jStj|��S)N�key)�hasattrrxr�_column_as_key)�attrs r<�_attr_as_keyr|ns,���t�U���/��x���(��.�.�.r>c��tj|d��}t|d��r+t|jd��rd�|jjD��S|gS)NF�
selectable�cc��g|]}|��S�r�)�.0rs  r<�
<listcomp>z _orm_columns.<locals>.<listcomp>xs��-�-�-�a��-�-�-r>)rrjryr~rros  r<�_orm_columnsr�usY����f�e�,�,�D��t�\�"�"��w�t���'D�'D��-�-�4�?�,�-�-�-�-��x�r>c�V�tj|d��}|duot|dd��S)NFru)rrj�getattrros  r<�_is_aliased_classr�}s1����f�e�,�,�D��t��H���.@�%� H� H�Hr>c
�`�tj|��}|jr
|}|j}n2|jr
|j}|}n!t
|d��r|jjx}}n|}	t||��S#t$r:}tjtjd|�d|�d���|���Yd}~dSd}~wwxYw)z�Return a class attribute given an entity and string name.

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

    r'zEntity 'z' has no property '�')�replace_contextN)rrj�
is_selectablerrurpryr'rPr��AttributeErrorr�raise_�sa_exc�InvalidRequestError)rprxrl�description�errs     r<�_entity_descriptorr��s����f�%�%�D���	�������	
�	��������	��x�	 �	 ��#�{�1�1��f�f���
��v�s�#�#�#���
�
�
����&�&�6A�k�k�3�3�3�G�
�
� �		
�	
�	
�	
�	
�	
�	
�	
�	
�	
�����
���s�A)�)
B-�3/B(�(B-zmanager.mapperFc��	t|��}|jsdS|j}|r|jr|���|S#t
j$rYdSwxYwrB)rG�	is_mappedr'�_new_mappers�_configure_allrrh)rP�	configure�
class_managerr's    r<�_inspect_mapped_classr��s}��
�(��0�0�
��&�	��4��%���	$��,�	$��!�!�#�#�#��
���<�����t�t����s�A�A�A�ATc��t||���}|�At|t��stjd|�d����tj|���|S)a�Given a class, return the primary :class:`_orm.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:`_sa.inspect`
    function as::

        inspect(some_mapped_class)

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

    )r�NzClass object expected, got 'z'.)r��
isinstance�typer��
ArgumentErrorrrg)rPr�r's   r<�class_mapperr��sg��"#�6�Y�
?�
?�
?�F�
�~��&�$�'�'�	��&�&�6<�f�f�>���
��$�V�,�,�,��
r>c�J�eZdZdZdZdZ	dZ	dZ	dZ	dZ		dZ
	dZ	dZ	e
ZdS)�InspectionAttra#A base class applied to all ORM objects that can be returned
    by the :func:`_sa.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.

    r�FN)r5�
__module__�__qualname__�__doc__�	__slots__r�ru�is_instancert�is_property�is_attribute�_is_internal_proxyrsr/�extension_typer�r>r<r�r��s}���������I��M�(���G��K�H��I�E��K�I��L�
������+�#�N��r>r�c�2�eZdZdZejd���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.

    c��iS)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:`_orm.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`

        r�)r9s r<�infozInspectionAttrInfo.info"s	��.�	r>N)r5r�r�r�r�memoized_propertyr�r�r>r<r�r�s=��������
��������r>r�c��eZdZdZdZdS)�_MappedAttributezVMixin for attributes which should be replaced by mapper-assigned
    attributes.

    r�N)r5r�r�r�r�r�r>r<r�r�<s��������
�I�I�Ir>r�)F)T)Lr��operator�rr�rr�sqlr�symbolr	r
rrr
rrrrrrrrrrrr r!r"r#r$rE�DEFAULT_STATE_ATTR�
_INSTRUMENTORr)r*r+r,r-r.r/�	frozenset�
_never_set�	_none_set�_SET_DEFERRED_EXPIRED�_DEFER_FOR_STATEr@rG�
attrgetterrJ�
instance_dictrMrIrXr]r_rbra�	_inspects�objectrdrmrqrvr|r�r�r��dottedgetter�
_state_mapperr�r�r�r�r�r�r�r>r<�<module>r�s��������������������������������������� �D�K������%����D�����t�{�������T�[��J���
�
�4�;������
�D�K���
�
�	�
�D�K����
�
�
�	��t�{��������
����L��
�
�
�� �D�K���������$�+�
���
���� �D�K��C������%�����������t�{��4�������4�;��:�������d�k��,��-�-��7�,�F��O�	����'�4�;����G�#�����
$����-�&��5�����
�4�;��.�+��:N�����'�4�;��%��-�-�����
&�$�+��%��-�-�����+��)��*�
��t�{�>�*�*���4�;�z�"�"���4�;�z�"�"���D�K���
�
�	�
�D�K���
�
�	��T�[�����
������	�	�
��Y�	�{�
#�
#�
��I�t�Y�(9�:�;�;�	�#���$:�;�;���4�;�0�1�1����� 8�8�8�%��$�%7�8�8��#��#�J�/�/�
�/�/�/�I�I�I�1�1�1�4�4�4�.�.�.�)�)�)�&���0���f��������6�6�6�	�	�	�
�
�
�/�/�/����I�I�I�

�
�
�<"��!�"2�3�3�
����d�������������8H�H�H�H�H�V�H�H�H�V � � � � �� � � �F�����v�����r>

Hacked By AnonymousFox1.0, Coded By AnonymousFox