File: //usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/__pycache__/relationships.cpython-310.pyc
o
���g�� � @ s� d Z ddlmZ ddlZddlmZ ddlZddlZddlZddl Z ddl
Z
ddl
mZ ddl
mZ ddl
m
Z
ddl
mZ dd l
mZ dd
l
mZ ddl
mZ ddl
mZ dd
l
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddl
mZ ddlZddlm Z ddlm!Z! ddl"m#Z# ddl"m$Z$ ddl%m&Z& ddl%m'Z' ddl%m(Z( dd l%m)Z) dd!l%m*Z* dd"l%m+Z+ dd#l%m,Z, dd$l%m-Z- dd%l.m/Z/ dd&l.m0Z0 dd'l.m1Z1 dd(l.m2Z2 dd)l.m3Z3 dd*l.m4Z4 dd+l.m5Z5 dd,l.m6Z6 dd-l7m8Z8 dd.l7m9Z9 dd/l7m:Z: d0d1lm;Z< d0d2lm=Z= d0d3lm>Z> d0d4lm?Z? d0d5lm@Z@ d0d6lm7Z7 d0d7lAmZ d0d8l@mBZB d0d9l@mCZC d0d:l@mDZD d0d;l@mEZE d0d<l@mFZF d0d=lGmHZH d0d>lGmIZI d0d?lJmKZK d0d@lLmMZM d0dAlLmNZN d0dBlOmPZP d0dClOmQZQ d0dDlOmRZR d0dElOmSZS d0dFlOmTZT d0dGlOmUZU d0dHlOmVZV d0dIlOmWZW d0dJlXmYZY d0dKlXmZZZ d0dLlXm[Z[ e
j\�r�ddMl"m]Z] ddNl"m^Z^ ddOl"m_Z_ ddPl"m`Z` ddQl"maZa ddRl"mbZb ddSl"mcZc ddTl%mdZd ddUlemfZf ddVlemgZg ddWlhmiZi ddXljmkZk ddYllmmZm ddZlnmoZo dd[lpmqZq dd\lrmsZs dd]ltmuZu dd^l7mvZv dd_l7mwZw d0d`lGmxZx d0dalGmyZy d0dblGmzZz d0dclJm{Z{ d0ddlJm|Z| d0delLm}Z} d0dflLm~Z~ d0dglLmZ d0dhl�m�Z� d0dil�m�Z� d0djlXm�Z� d0dklXm�Z� edledm�Z�ednedm�Z�edoedm�Z�edpedm�Z�edqedm�Z�ee�ee� eg ee� f drdseg drf eg dsf f Z�eZdt Z�ee�eHe� f Z�edue�eg duf f Z�eeZdv e�eHe eg eHe f eg eeHe f eee�eHe f f Z�ee�ee�ee�ef f f Z�eeMe eIe eEj�dwf Z�ee�ee� eg ee� f eg e�f e�f Z�edxeHe dm�Z�edydzdm�Z�eeeNe eNe f Z�eeeNe eNe f Z�eeeNe eNe f Z�d�d}d~�Z�d�dd��Z�ej�G d�d�� d�ee�e�f ��Z�eeZdv eeNe d�f f Z�G d�d�� d�e�Z�e>j�G d�d�� d�e0e6e� e>j���Z�d�d�d��Z�G d�d�� d��Z�G d�d�� d��Z�e�d�d��Z�e�d~d��Z�G d�d�� d�e�e� e&e� �Z�G d�d�� d�e�e� e-e� e)e� �Z�dS )�a
Heuristics related to join conditions as used in
:func:`_orm.relationship`.
Provides the :class:`.JoinCondition` object, which encapsulates
SQL annotation and aliasing behavior focused on the `primaryjoin`
and `secondaryjoin` aspects of :func:`_orm.relationship`.
� )�annotationsN)�abc)�Any)�Callable)�cast)�
Collection)�Dict)� FrozenSet)�Generic)�Iterable)�Iterator)�List)�
NamedTuple)�NoReturn)�Optional)�Sequence)�Set)�Tuple)�Type)�TypeVar)�Union� )�
attributes)�strategy_options)�insp_is_aliased_class)�is_has_collection_adapter)�_DeclarativeMapped)�_is_mapped_class)�class_mapper)�
DynamicMapped)�LoaderCallableStatus)�PassiveFlag)� state_str)�WriteOnlyMapped)�_AttributeOptions)�_IntrospectsAnnotations)�
MANYTOMANY)� MANYTOONE)� ONETOMANY)�PropComparator)�RelationshipDirection)�StrategizedProperty)�
_orm_annotate)�_orm_deannotate)�CascadeOptions� )�exc)�Exists)�log)�schema)�sql)�util)�inspect)� coercions)�
expression)� operators)�roles)�visitors)�_ColumnExpressionArgument)�_HasClauseElement)�_safe_annotate)�ColumnClause)�
ColumnElement��_deep_annotate)�_deep_deannotate)�_shallow_annotate)�adapt_criterion_to_null)�
ClauseAdapter)�join_condition)�selectables_overlap��visit_binary_product)�de_optionalize_union_types)�Literal)�resolve_name_to_real_class_name)�_EntityType)�_ExternalEntityType)�_IdentityKeyType)�
_InstanceDict)�_InternalEntityType)�_O)�
_RegistryType)�Mapped)�_class_resolver)�_ModNS)�_ClassScanMapperConfig)�DependencyProcessor)�Mapper)�Query)�Session)�
InstanceState)�
LazyLoader)�AliasedClass)�AliasedInsp)�_CoreAdapterProto)�_EquivalentColumnMap)� _InfoType)�_AnnotationDict)�SupportsAnnotations)�BinaryExpression)�
BindParameter)�
ClauseElement)�Table)�
FromClause)�_AnnotationScanType)�RODescriptorReference�_T)�bound�_T1�_T2�_PT�_PT2�
Mapper[_T]zAliasedClass[_T])
�select�joined�selectin�subquery�raise�raise_on_sql�noload� immediate�
write_only�dynamicTFNrj FzMapped[Any]�_CEA�_CE�ColumnElement[Any]�expr�returnc C � t t�tj| �ddi�S )a Annotate a portion of a primaryjoin expression
with a 'remote' annotation.
See the section :ref:`relationship_custom_foreign` for a
description of use.
.. seealso::
:ref:`relationship_custom_foreign`
:func:`.foreign`
�remoteT��_annotate_columnsr7 �expectr: �ColumnArgumentRole�r� � r� �G/usr/local/lib/python3.10/dist-packages/sqlalchemy/orm/relationships.pyr� � s �r� c C r� )a Annotate a portion of a primaryjoin expression
with a 'foreign' annotation.
See the section :ref:`relationship_custom_foreign` for a
description of use.
.. seealso::
:ref:`relationship_custom_foreign`
:func:`.remote`
�foreignTr� r� r� r� r� r� � s �r� c @ sB e Zd ZU dZdZded<