관리-도구
편집 파일: strategy_options.cpython-37.pyc
B ��4]�� � @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z ddlmZ dd lm Z dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ G dd� dee�ZG dd� de�ZG dd� de�Z e � dRdd��Z!e!j"dd� �Z!e � dd � �Z#e#j"d!d � �Z#e � dSd"d#��Z$e$j"d$d#� �Z$e$j%d%d&� �Z&e � d'd(� �Z'e'j"d)d(� �Z'e'j%d*d+� �Z(e � d,d-� �Z)e)j"d.d-� �Z)e)j%d/d0� �Z*e � d1d2� �Z+e+j"d3d2� �Z+e+j%d4d5� �Z,e � d6d7� �Z-e-j"d8d7� �Z-e � d9d:� �Z.e.j"d;d:� �Z.e � dTd=d>��Z/e/j"d?d>� �Z/e � d@dA� �Z0e0j"dBdA� �Z0e � dCdD� �Z1e1j"dEdD� �Z1e � dFdG� �Z2e2j"dHdG� �Z2e � dIdJ� �Z3e3j"dKdJ� �Z3e � dLdM� �Z4e4j"dNdM� �Z4e � dOdP� �Z5e5j"dQdP� �Z5dS )Uz � )�util)�QueryableAttribute)�_class_to_mapper)�_is_aliased_class)�_is_mapped_class)�InspectionAttr)�MapperOption)�PropComparator)�_DEFAULT_TOKEN)�_WILDCARD_TOKEN)�PathRegistry)� TokenRegistry)�_orm_full_deannotate� )�exc)�inspect)� expression)�_generative)� Generativec s� e Zd ZdZdd� Zedd� �Zdd� Z� fdd �Zd Z d Z dZd Zdd � Z dd� Zdd� Zd/dd�Zdd� Zdd� Zdd� Zedd� �Zed0dd��Zed1dd ��Zed!d"� �Zed#d$� �Zd2d%d&�Zd'd(� Zd)d*� Zd+d,� Zd-d.� Z� ZS )3�Loadaq Represents loader options which modify the state of a :class:`.Query` in order to affect how various mapped attributes are loaded. The :class:`.Load` object is in most cases used implicitly behind the scenes when one makes use of a query option like :func:`.joinedload`, :func:`.defer`, or similar. However, the :class:`.Load` object can also be used directly, and in some cases can be useful. To use :class:`.Load` directly, instantiate it with the target mapped class as the argument. This style of usage is useful when dealing with a :class:`.Query` that has multiple entities:: myopt = Load(MyClass).joinedload("widgets") The above ``myopt`` can now be used with :meth:`.Query.options`, where it will only take effect for the ``MyClass`` entity:: session.query(MyClass, MyOtherClass).options(myopt) One case where :class:`.Load` is useful as public API is when specifying "wildcard" options that only take effect for a certain class:: session.query(Order).options(Load(Order).lazyload('*')) Above, all relationships on ``Order`` will be lazy-loaded, but other attributes on those descendant objects will load using their normal loader strategy. .. seealso:: :ref:`deferred_options` :ref:`deferred_loading_w_multiple` :ref:`relationship_loader_options` c C s0 t |�}|j| _t�� | _i | _d | _d| _d S )NF) r Z_path_registry�pathr �OrderedDict�context� local_opts�_of_type�is_class_strategy)�self�entityZinsp� r �R/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/strategy_options.py�__init__H s z Load.__init__c C s&