Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/orm/__pycache__/query.cpython-39.pyc
Ðазад
a _�h�� � @ sF d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlm Z ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlmZ ddl!m"Z" ddl!mZ# ddl!m$Z$ dd l%m&Z& dd!l'm(Z( dd"l)m*Z* g d#�Z+ej,Z-ej.e j/G d$d%� d%e0���Z1G d&d'� d'e*�Z2G d(d)� d)e0�Z3G d*d+� d+e3�Z4ej.G d,d-� d-e��Z5G d.d/� d/e3�Z6G d0d1� d1e3�Z7G d2d3� d3e0�Z8G d4d5� d5ej9�Z:d6S )7a The Query class and support. Defines the :class:`_query.Query` class, the central construct used by the ORM to construct database queries. The :class:`_query.Query` class should not be confused with the :class:`_expression.Select` class, which defines database SELECT operations at the SQL (non-ORM) level. ``Query`` differs from ``Select`` in that it returns ORM-mapped objects and interacts with an ORM session, whereas the ``Select`` construct interacts directly with the database to return iterable result sets. � )�chain� )� attributes)�exc)� interfaces)�loading)�persistence)� properties��_entity_descriptor)�_generative)�_is_aliased_class)�_is_mapped_class��_orm_columns)�InspectionAttr)�PathRegistry)�_entity_corresponds_to)�aliased)�AliasedClass)�join)� object_mapper)� ORMAdapter)�with_parent� )�inspect)� inspection)�log)�sql)�util)� expression)�visitors)�ColumnCollection)�_interpret_as_from)�ForUpdateArg)�Query�QueryContextr c @ s� e Zd ZdZdZdZdZdZdZdZ dZ dZdZdZ dZdZdZdZdZdZe� ZdZdZdZdZdZdZdZdZdZdZi Z dZ!dZ"e#�$� Z%Z&e#�$� Z'e#�$� Z(e#�$� Z)dZ*dZ+dZ,dZ-dZ.e/Z0dZ1dZ2dZ3�ddd�Z4�ddd �Z5d d� Z6dd � Z7dd� Z8dd� Z9dd� Z:dd� Z;e<� dd� �Z=e<� dd� �Z>dd� Z?dd� Z@dd� ZAd d!� ZBeCd"d#� �ZDd$d%� ZEd&d'� ZFd(d)� ZG�dd*d+�ZHd,d-� ZId.d/� ZJd0d1� ZK�dd2d3�ZL�dd4d5�ZMd6d7� ZNd8d9� ZOd:d;� ZP�dd<d=�ZQd>d?� ZReCd@dA� �ZS�ddBdC�ZT�ddDdE�ZUdFdG� ZVdHdI� ZWeCdJdK� �ZXdLdM� ZYe<� dNdO� �ZZeCdPdQ� �Z[e<� dRdS� �Z\dTdU� Z]e<� dVdW� �Z^e<� dXdY� �Z_eCdZd[� �Z`e<� d\d]� �Zae<eN��dd^d_��Zbe<� d`da� �Zcdbdc� Zddeejfdfddde�Zg�ddfdg�Zhe<� dhdi� �Zie<� djdk� �Zje<� dldm� �Zke<� dndo� �Zl�ddpdq�Zme<� �ddrds��Zne<� dtdu� �Zodvdw� Zpe<� dxdy� �Zqe<� dzd{� �Zrd|d}� ZsesZtd~d� Zue<� d�d�� �Zve<� d�d�� �Zwe#�xd�d�d�d�d�� �Zyd�d�� Zzd�d�� Z{e<� d�d�� �Z|d�d�� Z}e<� �dd�d���Z~�dd�d��Zd�d�� Z�e<� d�d�� �Z�e<� e#��d�d��d�d�� ��Z�e<� �d d�d���Z�e<� d�d�� �Z�e<eOeP�d�d�� �Z�d�d�� Z�e<eOeP�d�d�� �Z�e<eOeP�d�d�� �Z�e<eOeP�d�d�� �Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�d�d�� Z�e<eOeP�d�d�� �Z�d�d Z�d�dĄ Z�d�dƄ Z�d�dȄ Z�d�dʄ Z�e<eO�d�d̄ �Z�e<eN�d�d΄ �Z�e<eN�d�dЄ �Z�d�d҄ Z�e<eO�d�dԄ �Z�e<eO�d�dք �Z�e<eO�d�d �Z�e<eO�d�dڄ �Z�e<� d�d܄ �Z�e<� d�dބ �Z�d�d� Z�e<eN�d�d� �Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d� Z�d�d�� Z�eCd�d�� �Z��d!d�d��Z��d"d�d��Z�eCd�d�� �Z�eCd��d � �Z��d�d� Z��d�d� Z��d#�d�d�Z��d$�d�d �Z��d%�d �d�Z��d�d � Z��d�d� Z��d�d� Z�dS (& r% ax ORM-level SQL construction object. :class:`_query.Query` is the source of all SELECT statements generated by the ORM, both those formulated by end-user query operations as well as by high level internal operations such as related collection loading. It features a generative interface whereby successive calls return a new :class:`_query.Query` object, a copy of the former with additional criteria and options associated with it. :class:`_query.Query` objects are normally initially generated using the :meth:`~.Session.query` method of :class:`.Session`, and in less common cases by instantiating the :class:`_query.Query` directly and associating with a :class:`.Session` using the :meth:`_query.Query.with_session` method. For a full walkthrough of :class:`_query.Query` usage, see the :ref:`ormtutorial_toplevel`. FTN� c C s || _ i | _| �|� dS )a� Construct a :class:`_query.Query` directly. E.g.:: q = Query([User, Address], session=some_session) The above is equivalent to:: q = some_session.query(User, Address) :param entities: a sequence of entities and/or SQL expressions. :param session: a :class:`.Session` with which the :class:`_query.Query` will be associated. Optional; a :class:`_query.Query` can be associated with a :class:`.Session` generatively via the :meth:`_query.Query.with_session` method as well. .. seealso:: :meth:`.Session.query` :meth:`_query.Query.with_session` N)�session�_polymorphic_adapters� _set_entities)�self�entitiesr( r'