Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/ext/declarative/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/ext/declarative/__pycache__/api.cpython-311.pyc

�

�܋f8p��X�dZddlZddlZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
l
mZddlm
Z
dd
lmZddlmZddlmZddlmZddlm
ZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"d�Z#d�Z$Gd�de%��Z&d1d!�Z'd"�Z(Gd#�d$ej)e*��Z+Gd%�d&e+��Z,ddde-d'ede&fd(�Z.d)�Z/Gd*�d+e-��Z0Gd,�d-e0��Z1Gd.�d/e-��Z2ej3e&��d0���Z4dS)2z1Public API functions and helpers for declarative.�N���_add_attribute)�_as_declarative)�_declarative_constructor)�_DeferredMapperConfig��_del_attribute)�_get_immediate_cls_attr)�_class_resolver�)�exc)�
inspection)�util)�
attributes��comparable_property)�
interfaces)�
properties)�synonym)�_inspect_mapped_class)�_mapper_or_none)�polymorphic_union)�MetaData)�Table)�hybridmethod)�hybridproperty)�OrderedDictc��d|jvrtjd|z���||_||_t||j|j��dS)z�Given a class, configure the class declaratively,
    using the given registry, which can be any dictionary, and
    MetaData object.

    �_decl_class_registryz4Class %r already has been instrumented declarativelyN)�__dict__r�InvalidRequestErrorr �metadatar�__name__)�cls�registryr#s   �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/ext/declarative/api.py�instrument_declarativer('s[�����-�-��%�E��K�
�
�	
� (�C���C�L��C���s�|�4�4�4�4�4�c�R�|jdd�D]}t|dd���dS�dS)aKGiven a class, return True if any of the classes it inherits from has a
    mapped table, otherwise return False.

    This is used in declarative mixins to build attributes that behave
    differently for the base class vs. a subclass in an inheritance
    hierarchy.

    .. seealso::

        :ref:`decl_mixin_inheritance`

    rN�	__table__TF)�__mro__�getattr)r%�class_s  r'�has_inherited_tabler/6s@���+�a�b�b�/�����6�;��-�-�9��4�4�:��5r)c� �eZdZd�Zd�Zd�ZdS)�DeclarativeMetac�~�d|jvrt|||j��t�||||��dS)Nr )r!r�type�__init__)r%�	classname�bases�dict_�kws     r'r4zDeclarativeMeta.__init__JsA��!���5�5��C��C�L�9�9�9��
�
�c�9�e�U�3�3�3�3�3r)c�(�t|||��dS�Nr)r%�key�values   r'�__setattr__zDeclarativeMeta.__setattr__Os���s�C��'�'�'�'�'r)c�&�t||��dSr:r	)r%r;s  r'�__delattr__zDeclarativeMeta.__delattr__Rs���s�C� � � � � r)N)r$�
__module__�__qualname__r4r=r?�r)r'r1r1IsA������4�4�4�
(�(�(�!�!�!�!�!r)r1Fc������fd�}|S)aDecorator that produces an :func:`_orm.synonym`
    attribute in conjunction
    with a Python descriptor.

    The function being decorated is passed to :func:`_orm.synonym` as the
    :paramref:`.orm.synonym.descriptor` parameter::

        class MyClass(Base):
            __tablename__ = 'my_table'

            id = Column(Integer, primary_key=True)
            _job_status = Column("job_status", String(50))

            @synonym_for("job_status")
            @property
            def job_status(self):
                return "Status: %s" % self._job_status

    The :ref:`hybrid properties <mapper_hybrids>` feature of SQLAlchemy
    is typically preferred instead of synonyms, which is a more legacy
    feature.

    .. seealso::

        :ref:`synonyms` - Overview of synonyms

        :func:`_orm.synonym` - the mapper-level function

        :ref:`mapper_hybrids` - The Hybrid Attribute extension provides an
        updated approach to augmenting attribute behavior more flexibly than
        can be achieved with synonyms.

    c�(��t��|���S)N)�
map_column�
descriptor)�_orm_synonym)�fnrE�names ��r'�decoratezsynonym_for.<locals>.decorateys����D�Z�B�G�G�G�Gr)rB)rIrErJs`` r'�synonym_forrKVs0����FH�H�H�H�H�H��Or)c����fd�}|S)a(Decorator, allow a Python @property to be used in query criteria.

    This is a  decorator front end to
    :func:`~sqlalchemy.orm.comparable_property` that passes
    through the comparator_factory and the function being decorated::

      @comparable_using(MyComparatorType)
      @property
      def prop(self):
          return 'special sauce'

    The regular ``comparable_property()`` is also usable directly in a
    declarative setting and may be convenient for read/write properties::

      prop = comparable_property(MyComparatorType)

    c�$��t�|��Sr:r)rH�comparator_factorys �r'rJz"comparable_using.<locals>.decorate�s���"�#5�r�:�:�:r)rB)rNrJs` r'�comparable_usingrOs#���&;�;�;�;�;��Or)c�V��eZdZdZd�fd�	Zd�Zed���Zed���Z	�xZ
S)�
declared_attraFMark a class-level method as representing the definition of
    a mapped property or special declarative member name.

    @declared_attr turns the attribute into a scalar-like
    property that can be invoked from the uninstantiated class.
    Declarative treats attributes specifically marked with
    @declared_attr as returning a construct that is specific
    to mapping or declarative table configuration.  The name
    of the attribute is that of what the non-dynamic version
    of the attribute would be.

    @declared_attr is more often than not applicable to mixins,
    to define relationships that are to be applied to different
    implementors of the class::

        class ProvidesUser(object):
            "A mixin that adds a 'user' relationship to classes."

            @declared_attr
            def user(self):
                return relationship("User")

    It also can be applied to mapped classes, such as to provide
    a "polymorphic" scheme for inheritance::

        class Employee(Base):
            id = Column(Integer, primary_key=True)
            type = Column(String(50), nullable=False)

            @declared_attr
            def __tablename__(cls):
                return cls.__name__.lower()

            @declared_attr
            def __mapper_args__(cls):
                if cls.__name__ == 'Employee':
                    return {
                            "polymorphic_on":cls.type,
                            "polymorphic_identity":"Employee"
                    }
                else:
                    return {"polymorphic_identity":cls.__name__}

    Fc�~��tt|���|��|j|_||_dSr:)�superrQr4�__doc__�
_cascading)�self�fget�	cascading�	__class__s   �r'r4zdeclared_attr.__init__�s5���
�m�T�"�"�+�+�D�1�1�1��|���#����r)c�n�|j�dd��}|�qtjd|jj��s=t
j|���)tj	d|jj�d|j����|�|��S||vr||S|�|��x||<}|S)N�_sa_declared_attr_regz^__.+__$z*Unmanaged access of declarative attribute z from non-mapped class )
r!�get�re�matchrWr$r�manager_of_classr�warn)�descrVr%�reg�objs     r'�__get__zdeclared_attr.__get__�s����l���6��=�=���;��H�[�$�)�*<�=�=�
��/��4�4�<��	�	�-1�Y�-?�-?�-?����O�����9�9�S�>�>�!�
�S�[�[��t�9��"�i�i��n�n�,�C��I���Jr)c��tdi|��S�NrB)�_stateful_declared_attr�r%r8s  r'�	_statefulzdeclared_attr._stateful�s��&�,�,��,�,�,r)c�.�|�d���S)aMark a :class:`.declared_attr` as cascading.

        This is a special-use modifier which indicates that a column
        or MapperProperty-based declared attribute should be configured
        distinctly per mapped subclass, within a mapped-inheritance scenario.

        .. warning::

            The :attr:`.declared_attr.cascading` modifier has several
            limitations:

            * The flag **only** applies to the use of :class:`.declared_attr`
              on declarative mixin classes and ``__abstract__`` classes; it
              currently has no effect when used on a mapped class directly.

            * The flag **only** applies to normally-named attributes, e.g.
              not any special underscore attributes such as ``__tablename__``.
              On these attributes it has **no** effect.

            * The flag currently **does not allow further overrides** down
              the class hierarchy; if a subclass tries to override the
              attribute, a warning is emitted and the overridden attribute
              is skipped.  This is a limitation that it is hoped will be
              resolved at some point.

        Below, both MyClass as well as MySubClass will have a distinct
        ``id`` Column object established::

            class HasIdMixin(object):
                @declared_attr.cascading
                def id(cls):
                    if has_inherited_table(cls):
                        return Column(
                            ForeignKey('myclass.id'), primary_key=True
                        )
                    else:
                        return Column(Integer, primary_key=True)

            class MyClass(HasIdMixin, Base):
                __tablename__ = 'myclass'
                # ...

            class MySubClass(MyClass):
                ""
                # ...

        The behavior of the above configuration is that ``MySubClass``
        will refer to both its own ``id`` column as well as that of
        ``MyClass`` underneath the attribute named ``some_id``.

        .. seealso::

            :ref:`declarative_inheritance`

            :ref:`mixin_inheritance_columns`


        T)rX)ri�r%s r'rXzdeclared_attr.cascading�s��x�}�}�t�}�,�,�,r)�F)r$r@rArTr4rdrrirrX�
__classcell__)rYs@r'rQrQ�s��������+�+�Z$�$�$�$�$�$�
���$�-�-��\�-��;-�;-��^�;-�;-�;-�;-�;-r)rQc� �eZdZd�Zd�Zd�ZdS)rgc��||_dSr:)r8)rVr8s  r'r4z _stateful_declared_attr.__init__!s
������r)c�v�|j���}|�|��tdi|��Srf)r8�copy�updaterg)rVr8�new_kws   r'riz!_stateful_declared_attr._stateful$s7����������
�
�b����&�0�0��0�0�0r)c�&�t|fi|j��Sr:)rQr8)rVrHs  r'�__call__z _stateful_declared_attr.__call__)s���R�+�+�4�7�+�+�+r)N)r$r@rAr4rirurBr)r'rgrg sA���������1�1�1�
,�,�,�,�,r)rg�Basec�*�|p
t��}|r||_|�tj��}t	|t
��r|fp|}	t
||���}
t	|t��r
|j|
d<|r||
d<|r||
d<|||	|
��S)aT
Construct a base class for declarative class definitions.

    The new base class will be given a metaclass that produces
    appropriate :class:`~sqlalchemy.schema.Table` objects and makes
    the appropriate :func:`~sqlalchemy.orm.mapper` calls based on the
    information provided declaratively in the class and any subclasses
    of the class.

    :param bind: An optional
      :class:`~sqlalchemy.engine.Connectable`, will be assigned
      the ``bind`` attribute on the :class:`~sqlalchemy.schema.MetaData`
      instance.

    :param metadata:
      An optional :class:`~sqlalchemy.schema.MetaData` instance.  All
      :class:`~sqlalchemy.schema.Table` objects implicitly declared by
      subclasses of the base will share this MetaData.  A MetaData instance
      will be created if none is provided.  The
      :class:`~sqlalchemy.schema.MetaData` instance will be available via the
      `metadata` attribute of the generated declarative base class.

    :param mapper:
      An optional callable, defaults to :func:`~sqlalchemy.orm.mapper`. Will
      be used to map subclasses to their Tables.

    :param cls:
      Defaults to :class:`object`. A type to use as the base for the generated
      declarative base class. May be a class or tuple of classes.

    :param name:
      Defaults to ``Base``.  The display name for the generated
      class.  Customizing this is not required, but can improve clarity in
      tracebacks and debugging.

    :param constructor:
      Defaults to
      :func:`~sqlalchemy.ext.declarative.base._declarative_constructor`, an
      __init__ implementation that assigns \**kwargs for declared
      fields and relationships to an instance.  If ``None`` is supplied,
      no __init__ will be provided and construction will fall back to
      cls.__init__ by way of the normal Python semantics.

    :param class_registry: optional dictionary that will serve as the
      registry of class names-> mapped classes when string names
      are used to identify classes inside of :func:`_orm.relationship`
      and others.  Allows two or more declarative base classes
      to share the same registry of class names for simplified
      inter-base relationships.

    :param metaclass:
      Defaults to :class:`.DeclarativeMeta`.  A metaclass or __metaclass__
      compatible callable to use as the meta type of the generated
      declarative base class.

    .. versionchanged:: 1.1 if :paramref:`.declarative_base.cls` is a
         single class (rather than a tuple), the constructed base class will
         inherit its docstring.

    .. seealso::

        :func:`.as_declarative`

    N)r r#rTr4�__mapper_cls__)	r�bind�weakref�WeakValueDictionary�
isinstance�tuple�dictr3rT)ryr#�mapperr%rI�constructor�class_registry�	metaclass�lcl_metadatar6�
class_dicts           r'�declarative_baser�-s���R�)�x�z�z�L��!� ����� �4�6�6���3��&�&�&�1�C�6�8�S�E��+�l����J��#�t���,� #��
�9���-�!,�
�:��
�.�'-�
�#�$��9�T�5�*�-�-�-r)c����fd�}|S)a�
    Class decorator for :func:`.declarative_base`.

    Provides a syntactical shortcut to the ``cls`` argument
    sent to :func:`.declarative_base`, allowing the base class
    to be converted in-place to a "declarative" base::

        from sqlalchemy.ext.declarative import as_declarative

        @as_declarative()
        class Base(object):
            @declared_attr
            def __tablename__(cls):
                return cls.__name__.lower()
            id = Column(Integer, primary_key=True)

        class MyMappedClass(Base):
            # ...

    All keyword arguments passed to :func:`.as_declarative` are passed
    along to :func:`.declarative_base`.

    .. seealso::

        :func:`.declarative_base`

    c�:��|�d<|j�d<tdi���S)Nr%rIrB)r$r�rhs �r'rJz as_declarative.<locals>.decorate�s+�����5�	��\��6�
��%�%�"�%�%�%r)rB)r8rJs` r'�as_declarativer��s#���:&�&�&�&�&�
�Or)c�>�eZdZdZed���Zed���ZdS)�ConcreteBasea�A helper class for 'concrete' declarative mappings.

    :class:`.ConcreteBase` will use the :func:`.polymorphic_union`
    function automatically, against all tables mapped as a subclass
    to this class.   The function is called via the
    ``__declare_last__()`` function, which is essentially
    a hook for the :meth:`.after_configured` event.

    :class:`.ConcreteBase` produces a mapped
    table for the class itself.  Compare to :class:`.AbstractConcreteBase`,
    which does not.

    Example::

        from sqlalchemy.ext.declarative import ConcreteBase

        class Employee(ConcreteBase, Base):
            __tablename__ = 'employee'
            employee_id = Column(Integer, primary_key=True)
            name = Column(String(50))
            __mapper_args__ = {
                            'polymorphic_identity':'employee',
                            'concrete':True}

        class Manager(Employee):
            __tablename__ = 'manager'
            employee_id = Column(Integer, primary_key=True)
            name = Column(String(50))
            manager_data = Column(String(40))
            __mapper_args__ = {
                            'polymorphic_identity':'manager',
                            'concrete':True}


    The name of the discriminator column used by :func:`.polymorphic_union`
    defaults to the name ``type``.  To suit the use case of a mapping where an
    actual column in a mapped table is already named ``type``, the
    discriminator name can be configured by setting the
    ``_concrete_discriminator_name`` attribute::

        class Employee(ConcreteBase, Base):
            _concrete_discriminator_name = '_concrete_discriminator'

    .. versionadded:: 1.3.19 Added the ``_concrete_discriminator_name``
       attribute to :class:`_declarative.ConcreteBase` so that the
       virtual discriminator column name can be customized.

    .. seealso::

        :class:`.AbstractConcreteBase`

        :ref:`concrete_inheritance`


    c�R�ttd�|D����|d��S)Nc3�2K�|]}|j|jfV��dSr:)�polymorphic_identity�local_table)�.0�mps  r'�	<genexpr>z9ConcreteBase._create_polymorphic_union.<locals>.<genexpr>�s=������>@��(�"�.�9������r)�pjoin)rr)r%�mappers�discriminator_names   r'�_create_polymorphic_unionz&ConcreteBase._create_polymorphic_union�sE�� ����DK����
�
�
��
�
�	
r)c��|j}|jrdSt|d��pd}t|j��}|�||��}|�d|f��|�|j|��dS)N�_concrete_discriminator_namer3�*)	�
__mapper__�with_polymorphicr�list�self_and_descendantsr��_set_with_polymorphic�_set_polymorphic_on�c)r%�mr�r�r�s     r'�__declare_first__zConcreteBase.__declare_first__�s����N����	��F�
$�C�)G�H�H�
��	�
�q�-�.�.���-�-�g�7I�J�J��	����e��-�-�-�	���e�g�&8�9�:�:�:�:�:r)N)r$r@rArT�classmethodr�r�rBr)r'r�r��sU������6�6�p�
�
��[�
��
;�
;��[�
;�
;�
;r)r�c�X�eZdZdZdZed���Zed���Zed���ZdS)�AbstractConcreteBasea7A helper class for 'concrete' declarative mappings.

    :class:`.AbstractConcreteBase` will use the :func:`.polymorphic_union`
    function automatically, against all tables mapped as a subclass
    to this class.   The function is called via the
    ``__declare_last__()`` function, which is essentially
    a hook for the :meth:`.after_configured` event.

    :class:`.AbstractConcreteBase` does produce a mapped class
    for the base class, however it is not persisted to any table; it
    is instead mapped directly to the "polymorphic" selectable directly
    and is only used for selecting.  Compare to :class:`.ConcreteBase`,
    which does create a persisted table for the base class.

    .. note::

        The :class:`.AbstractConcreteBase` class does not intend to set up  the
        mapping for the base class until all the subclasses have been defined,
        as it needs to create a mapping against a selectable that will include
        all subclass tables.  In order to achieve this, it waits for the
        **mapper configuration event** to occur, at which point it scans
        through all the configured subclasses and sets up a mapping that will
        query against all subclasses at once.

        While this event is normally invoked automatically, in the case of
        :class:`.AbstractConcreteBase`, it may be necessary to invoke it
        explicitly after **all** subclass mappings are defined, if the first
        operation is to be a query against this base class.  To do so, invoke
        :func:`.configure_mappers` once all the desired classes have been
        configured::

            from sqlalchemy.orm import configure_mappers

            configure_mappers()

        .. seealso::

            :func:`_orm.configure_mappers`


    Example::

        from sqlalchemy.ext.declarative import AbstractConcreteBase

        class Employee(AbstractConcreteBase, Base):
            pass

        class Manager(Employee):
            __tablename__ = 'manager'
            employee_id = Column(Integer, primary_key=True)
            name = Column(String(50))
            manager_data = Column(String(40))

            __mapper_args__ = {
                'polymorphic_identity':'manager',
                'concrete':True}

        configure_mappers()

    The abstract base class is handled by declarative in a special way;
    at class configuration time, it behaves like a declarative mixin
    or an ``__abstract__`` base class.   Once classes are configured
    and mappings are produced, it then gets mapped itself, but
    after all of its descendants.  This is a very unique system of mapping
    not found in any other SQLAlchemy system.

    Using this approach, we can specify columns and properties
    that will take place on mapped subclasses, in the way that
    we normally do as in :ref:`declarative_mixins`::

        class Company(Base):
            __tablename__ = 'company'
            id = Column(Integer, primary_key=True)

        class Employee(AbstractConcreteBase, Base):
            employee_id = Column(Integer, primary_key=True)

            @declared_attr
            def company_id(cls):
                return Column(ForeignKey('company.id'))

            @declared_attr
            def company(cls):
                return relationship("Company")

        class Manager(Employee):
            __tablename__ = 'manager'

            name = Column(String(50))
            manager_data = Column(String(40))

            __mapper_args__ = {
                'polymorphic_identity':'manager',
                'concrete':True}

        configure_mappers()

    When we make use of our mappings however, both ``Manager`` and
    ``Employee`` will have an independently usable ``.company`` attribute::

        session.query(Employee).filter(Employee.company.has(id=5))

    .. versionchanged:: 1.0.0 - The mechanics of :class:`.AbstractConcreteBase`
       have been reworked to support relationships established directly
       on the abstract base, without any special configurational steps.

    .. seealso::

        :class:`.ConcreteBase`

        :ref:`concrete_inheritance`

    Tc�.�|���dSr:)�_sa_decl_prepare_nocascaderks r'r�z&AbstractConcreteBase.__declare_first__{s���&�&�(�(�(�(�(r)c�~�
���t|dd��rdStj|��}g}t|�����}|rc|���}|�|�����t|��}|�|�|��|�ct|d��pd�
|�
|�
���t|j��}t|j
�����D]#\}}||vr�j|j|j
|<�$�|_|jpt&��
��fd�}	|	|_|���}
|���D]8}t|��}|r%|jr||jvr|�|
���9dS)Nr�r�r3c�<�����}�j�|d<|S)N�polymorphic_on)r�)�argsr��m_argsr�s ���r'�mapper_argszDAbstractConcreteBase._sa_decl_prepare_nocascade.<locals>.mapper_args�s&����6�8�8�D�%*�W�-?�%@�D�!�"��Kr))r-r�config_for_clsr��__subclasses__�pop�extendr�appendrr��set�declared_columnsr�itemsr�r;r��mapper_args_fnr~�map�concrete�	__bases__�_set_concrete_base)r%�to_mapr��stack�klass�mn�
declared_cols�k�vr�r��scls�smr�r�r�s             @@@r'r�z/AbstractConcreteBase._sa_decl_prepare_nocascades�������3��d�+�+�	��F�&�5�c�:�:�����S�'�'�)�)�*�*���	#��I�I�K�K�E��L�L��-�-�/�/�0�0�0� ��'�'�B��~����r�"�"�"��	#�
$�C�)G�H�H�
��	��-�-�g�7I�J�J���F�3�4�4�
���*�0�0�2�2�3�3�	6�	6�D�A�q��M�!�!�',�w�q�u�~��!�!�$��"����&�.�$��	�	�	�	�	�	�	�
!,����J�J�L�L���&�&�(�(�	)�	)�D� ��&�&�B��
)�b�k�
)�c�T�^�&;�&;��%�%�a�(�(�(��	)�	)r)c�X�tj|dtj|��z����)Nz�Class %s is a subclass of AbstractConcreteBase and has a mapping pending until all subclasses are defined. Call the sqlalchemy.orm.configure_mappers() function after all subclasses have been defined to complete the mapping of this class.��msg��orm_exc�UnmappedClassError�_safe_cls_namerks r'�_sa_raise_deferred_configz.AbstractConcreteBase._sa_raise_deferred_config�s9���(��2�
�$�S�)�)�*�
�
�
�	
r)N)	r$r@rArT�__no_table__r�r�r�r�rBr)r'r�r�sx������p�p�d�L��)�)��[�)��4)�4)��[�4)�l�	
�	
��[�	
�	
�	
r)r�c��eZdZdZed���Zed���Zed���Zed���Zed���Z	dS)�DeferredReflectiona�	A helper class for construction of mappings based on
    a deferred reflection step.

    Normally, declarative can be used with reflection by
    setting a :class:`_schema.Table` object using autoload=True
    as the ``__table__`` attribute on a declarative class.
    The caveat is that the :class:`_schema.Table` must be fully
    reflected, or at the very least have a primary key column,
    at the point at which a normal declarative mapping is
    constructed, meaning the :class:`_engine.Engine` must be available
    at class declaration time.

    The :class:`.DeferredReflection` mixin moves the construction
    of mappers to be at a later point, after a specific
    method is called which first reflects all :class:`_schema.Table`
    objects created so far.   Classes can define it as such::

        from sqlalchemy.ext.declarative import declarative_base
        from sqlalchemy.ext.declarative import DeferredReflection
        Base = declarative_base()

        class MyClass(DeferredReflection, Base):
            __tablename__ = 'mytable'

    Above, ``MyClass`` is not yet mapped.   After a series of
    classes have been defined in the above fashion, all tables
    can be reflected and mappings created using
    :meth:`.prepare`::

        engine = create_engine("someengine://...")
        DeferredReflection.prepare(engine)

    The :class:`.DeferredReflection` mixin can be applied to individual
    classes, used as the base for the declarative base itself,
    or used in a custom abstract class.   Using an abstract base
    allows that only a subset of classes to be prepared for a
    particular prepare step, which is necessary for applications
    that use more than one engine.  For example, if an application
    has two engines, you might use two bases, and prepare each
    separately, e.g.::

        class ReflectedOne(DeferredReflection, Base):
            __abstract__ = True

        class ReflectedTwo(DeferredReflection, Base):
            __abstract__ = True

        class MyClass(ReflectedOne):
            __tablename__ = 'mytable'

        class MyOtherClass(ReflectedOne):
            __tablename__ = 'myothertable'

        class YetAnotherClass(ReflectedTwo):
            __tablename__ = 'yetanothertable'

        # ... etc.

    Above, the class hierarchies for ``ReflectedOne`` and
    ``ReflectedTwo`` can be configured separately::

        ReflectedOne.prepare(engine_one)
        ReflectedTwo.prepare(engine_two)

    c�8�tj|��}|D�]}|�|j|��|���|jj}|jj}|j	�
��D]�}t|tj
��r�|j�zt|jt��r|�|j|���Yt|jt"��r*|jxj|�||��fz
c_����dS)zjReflect all :class:`_schema.Table` objects for all current
        :class:`.DeferredReflection` subclassesN)r�classes_for_base�_sa_decl_preparer�r�r%r�r.r#�_props�valuesr|r�RelationshipProperty�	secondaryr�_reflect_tabler�
_resolvers�_sa_deferred_table_resolver)r%�enginer��thingyrr#�rels       r'�preparezDeferredReflection.prepares��
'�7��<�<���	�	�F�� � ��!3�V�<�<�<��J�J�L�L�L��Z�*�F��}�-�H��}�+�+�-�-�

�

���s�J�$C�D�D�	��
�1�!�#�-��7�7���*�*�3�=�&�A�A�A�A�#�C�M�?�C�C���
�0�0��;�;�F�H�M�M�5��0�0��

�	�	r)c��������fd�}|S)Nc�T��t|���}��|���|Sr:)rr�)r;�t1r%r�r#s  ���r'�_resolvez@DeferredReflection._sa_deferred_table_resolver.<locals>._resolves-����s�H�%�%�B����r�6�*�*�*��Ir)rB)r%r�r#r�s``` r'r�z.DeferredReflection._sa_deferred_table_resolvers/�����	�	�	�	�	�	�	�
�r)c�:�|�|�||��dSdSr:)r�)r%r�r�s   r'r�z#DeferredReflection._sa_decl_prepare&s.���"����{�F�3�3�3�3�3�#�"r)c�X�tj|dtj|��z����)Nz�Class %s is a subclass of DeferredReflection.  Mappings are not produced until the .prepare() method is called on the class hierarchy.r�r�rks r'r�z,DeferredReflection._sa_raise_deferred_config/s9���(��7��$�S�)�)�*�
�
�
�	
r)c	�P�t|j|jddd||j���dS)NTF)�extend_existing�autoload_replace�autoload�
autoload_with�schema)rrIr#r�)r%�tabler�s   r'r�z!DeferredReflection._reflect_table9s>��
��J��N� �"�� ��<�	
�	
�	
�	
�	
�	
r)N)
r$r@rArTr�r�r�r�r�r�rBr)r'r�r��s�������@�@�D����[��,����[���4�4��[�4��
�
��[�
��	
�	
��[�	
�	
�	
r)r�c���t|��}|�Stj|��r?tj|��t	j|dt	j|��z����|S)NzOClass %s has a deferred mapping on it.  It is not yet usable as a mapped class.r�)rr�has_cls�raise_unmapped_for_clsr�r�r�)r%r�s  r'�_inspect_decl_metar�Fsu��	�s�	#�	#�B�	�z� �(��-�-�	�!�8��=�=�=��,��,�.5�.D�S�.I�.I�J����
�
�Ir)rl)5rTr]rz�baserrrrr
r�clsregistryr�rrr�ormrrr�rrrrG�orm.baserr�orm.utilrr�rrrrrr(r/r3r1rKrO�_MappedAttribute�propertyrQrg�objectr�r�r�r�r��	_inspectsr�rBr)r'�<module>r�s���8�7�
�	�	�	����� � � � � � �!�!�!�!�!�!�*�*�*�*�*�*�'�'�'�'�'�'� � � � � � �)�)�)�)�)�)�(�(�(�(�(�(�������������������������&�&�&�&�&�&�!�!�!�!�!�!�������������*�*�*�*�*�*�-�-�-�-�-�-�'�'�'�'�'�'�)�)�)�)�)�)������������� � � � � � �"�"�"�"�"�"�������5�5�5����&
!�
!�
!�
!�
!�d�
!�
!�
!�&�&�&�&�R���2E-�E-�E-�E-�E-�J�/��E-�E-�E-�P
,�
,�
,�
,�
,�m�
,�
,�
,�
�
���	�(���].�].�].�].�@"�"�"�JQ;�Q;�Q;�Q;�Q;�6�Q;�Q;�Q;�hz
�z
�z
�z
�z
�<�z
�z
�z
�z@
�@
�@
�@
�@
��@
�@
�@
�F���o�&�&�
�
�'�&�
�
�
r)

Hacked By AnonymousFox1.0, Coded By AnonymousFox