PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
 ec@@sdZddlmZddlZddlZddlZddlmZddlm Z ddlm Z ddlm Z dd l m Z dd l mZdd l mZdd l mZdd l mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!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)d$Z*d%Z+ej,d&efd'YZ-d(Z.d)e/fd*YZ0d+e/fd,YZ1dS(-s 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`. i(tabsolute_importNi(t attributes(t_is_mapped_class(t PASSIVE_MERGE(t state_str(t MANYTOMANY(t MANYTOONE(t ONETOMANY(tPropComparator(tStrategizedProperty(t _orm_annotate(t_orm_deannotate(tCascadeOptionsi(texc(tlog(tschema(tsql(tutil(tinspect(t coercions(t expression(t operators(troles(tvisitors(t_deep_deannotate(t_shallow_annotate(tadapt_criterion_to_null(t ClauseAdapter(tjoin_condition(tselectables_overlap(tvisit_binary_productcC@s#ttjtj|itd6S(sAnnotate 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` tremote(t_annotate_columnsRtexpectRtColumnArgumentRoletTrue(texpr((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR6scC@s#ttjtj|itd6S(sAnnotate 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` tforeign(R RR!RR"R#(R$((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR%IstRelationshipPropertyc#B@seZdZdZeZeZedededededeZ e Z e e e e e ee e e eeede e de de e de e eee e e de deee e e e e ed"Z d Z d Zd efd YZee d Zee edZdZee dZdZdZejdZe dZedZedZdZe j!e j"ddZ#e j!dZ$dZ%dZ&dZ'dZ(edZ)ed Z*e j!e j"d!d"Z+e j"dd#Z,ed$Z-e-j.d%Z-d&Z/d'Z0d(Z1d)Z2d*Z3e j"d+d,Z4e j!d-Z5e j!d.Z6ee e e efd/Z7RS(0sDescribes an object property that holds a single item or list of items that correspond to a related database table. Public constructor is the :func:`_orm.relationship` function. .. seealso:: :ref:`relationship_config_toplevel` t relationshiptpassive_deletestpassive_updatestenable_typecheckstactive_historytcascade_backrefstselectc$$ C@stt|j||_||_||_||_||_| |_t |_ | |_ | r|j d|d|d|d|d|n| o|"rt jdn|"|_||_||_||_||_||_||_||_||_||_||_||_||_||_||_|#|_||_|!rYt j!dn|!|_"||_#||_$||_%|ptj&|_'|j'|t |_(t j)|| t k r| |_*nd|jff|_+t,|_-| rt,t.j/d | |_0n f|_0| t1k r/| |_2n|j rDd |_2n d |_2||_3| |_4|j4r|rt jd nt |_5n ||_5d S(s(Provide a relationship between two mapped classes. This corresponds to a parent-child or associative table relationship. The constructed class is an instance of :class:`.RelationshipProperty`. A typical :func:`_orm.relationship`, used in a classical mapping:: mapper(Parent, properties={ 'children': relationship(Child) }) Some arguments accepted by :func:`_orm.relationship` optionally accept a callable function, which when called produces the desired value. The callable is invoked by the parent :class:`_orm.Mapper` at "mapper initialization" time, which happens only when mappers are first used, and is assumed to be after all mappings have been constructed. This can be used to resolve order-of-declaration and other dependency issues, such as if ``Child`` is declared below ``Parent`` in the same file:: mapper(Parent, properties={ "children":relationship(lambda: Child, order_by=lambda: Child.id) }) When using the :ref:`declarative_toplevel` extension, the Declarative initializer allows string arguments to be passed to :func:`_orm.relationship`. These string arguments are converted into callables that evaluate the string as Python code, using the Declarative class-registry as a namespace. This allows the lookup of related classes to be automatic via their string name, and removes the need for related classes to be imported into the local module space before the dependent classes have been declared. It is still required that the modules in which these related classes appear are imported anywhere in the application at some point before the related mappings are actually used, else a lookup error will be raised when the :func:`_orm.relationship` attempts to resolve the string reference to the related class. An example of a string- resolved class is as follows:: from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Parent(Base): __tablename__ = 'parent' id = Column(Integer, primary_key=True) children = relationship("Child", order_by="Child.id") .. seealso:: :ref:`relationship_config_toplevel` - Full introductory and reference documentation for :func:`_orm.relationship`. :ref:`tutorial_orm_related_objects` - ORM tutorial introduction. :param argument: A mapped class, or actual :class:`_orm.Mapper` instance, representing the target of the relationship. :paramref:`_orm.relationship.argument` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a string name when using Declarative. .. warning:: Prior to SQLAlchemy 1.3.16, this value is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. .. versionchanged 1.3.16:: The string evaluation of the main "argument" no longer accepts an open ended Python expression, instead only accepting a string class name or dotted package-qualified name. .. seealso:: :ref:`declarative_configuring_relationships` - further detail on relationship configuration when using Declarative. :param secondary: For a many-to-many relationship, specifies the intermediary table, and is typically an instance of :class:`_schema.Table`. In less common circumstances, the argument may also be specified as an :class:`_expression.Alias` construct, or even a :class:`_expression.Join` construct. :paramref:`_orm.relationship.secondary` may also be passed as a callable function which is evaluated at mapper initialization time. When using Declarative, it may also be a string argument noting the name of a :class:`_schema.Table` that is present in the :class:`_schema.MetaData` collection associated with the parent-mapped :class:`_schema.Table`. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. The :paramref:`_orm.relationship.secondary` keyword argument is typically applied in the case where the intermediary :class:`_schema.Table` is not otherwise expressed in any direct class mapping. If the "secondary" table is also explicitly mapped elsewhere (e.g. as in :ref:`association_pattern`), one should consider applying the :paramref:`_orm.relationship.viewonly` flag so that this :func:`_orm.relationship` is not used for persistence operations which may conflict with those of the association object pattern. .. seealso:: :ref:`relationships_many_to_many` - Reference example of "many to many". :ref:`self_referential_many_to_many` - Specifics on using many-to-many in a self-referential case. :ref:`declarative_many_to_many` - Additional options when using Declarative. :ref:`association_pattern` - an alternative to :paramref:`_orm.relationship.secondary` when composing association table relationships, allowing additional attributes to be specified on the association table. :ref:`composite_secondary_join` - a lesser-used pattern which in some cases can enable complex :func:`_orm.relationship` SQL conditions to be used. .. versionadded:: 0.9.2 :paramref:`_orm.relationship.secondary` works more effectively when referring to a :class:`_expression.Join` instance. :param active_history=False: When ``True``, indicates that the "previous" value for a many-to-one reference should be loaded when replaced, if not already loaded. Normally, history tracking logic for simple many-to-ones only needs to be aware of the "new" value in order to perform a flush. This flag is available for applications that make use of :func:`.attributes.get_history` which also need to know the "previous" value of the attribute. :param backref: A reference to a string relationship name, or a :func:`_orm.backref` construct, which will be used to automatically generate a new :func:`_orm.relationship` on the related class, which then refers to this one using a bi-directional :paramref:`_orm.relationship.back_populates` configuration. In modern Python, explicit use of :func:`_orm.relationship` with :paramref:`_orm.relationship.back_populates` should be preferred, as it is more robust in terms of mapper configuration as well as more conceptually straightforward. It also integrates with new :pep:`484` typing features introduced in SQLAlchemy 2.0 which is not possible with dynamically generated attributes. .. seealso:: :ref:`relationships_backref` - notes on using :paramref:`_orm.relationship.backref` :ref:`tutorial_orm_related_objects` - in the :ref:`unified_tutorial`, presents an overview of bi-directional relationship configuration and behaviors using :paramref:`_orm.relationship.back_populates` :func:`.backref` - allows control over :func:`_orm.relationship` configuration when using :paramref:`_orm.relationship.backref`. :param back_populates: Indicates the name of a :func:`_orm.relationship` on the related class that will be synchronized with this one. It is usually expected that the :func:`_orm.relationship` on the related class also refer to this one. This allows objects on both sides of each :func:`_orm.relationship` to synchronize in-Python state changes and also provides directives to the :term:`unit of work` flush process how changes along these relationships should be persisted. .. seealso:: :ref:`tutorial_orm_related_objects` - in the :ref:`unified_tutorial`, presents an overview of bi-directional relationship configuration and behaviors. :ref:`relationship_patterns` - includes many examples of :paramref:`_orm.relationship.back_populates`. :param overlaps: A string name or comma-delimited set of names of other relationships on either this mapper, a descendant mapper, or a target mapper with which this relationship may write to the same foreign keys upon persistence. The only effect this has is to eliminate the warning that this relationship will conflict with another upon persistence. This is used for such relationships that are truly capable of conflicting with each other on write, but the application will ensure that no such conflicts occur. .. versionadded:: 1.4 .. seealso:: :ref:`error_qzyx` - usage example :param bake_queries=True: Legacy parameter, not used. .. versionchanged:: 1.4.23 the "lambda caching" system is no longer used by loader strategies and the ``bake_queries`` parameter has no effect. :param cascade: A comma-separated list of cascade rules which determines how Session operations should be "cascaded" from parent to child. This defaults to ``False``, which means the default cascade should be used - this default cascade is ``"save-update, merge"``. The available cascades are ``save-update``, ``merge``, ``expunge``, ``delete``, ``delete-orphan``, and ``refresh-expire``. An additional option, ``all`` indicates shorthand for ``"save-update, merge, refresh-expire, expunge, delete"``, and is often used as in ``"all, delete-orphan"`` to indicate that related objects should follow along with the parent object in all cases, and be deleted when de-associated. .. seealso:: :ref:`unitofwork_cascades` - Full detail on each of the available cascade options. :param cascade_backrefs=True: A boolean value indicating if the ``save-update`` cascade should operate along an assignment event intercepted by a backref. When set to ``False``, the attribute managed by this relationship will not cascade an incoming transient object into the session of a persistent parent, if the event is received via backref. .. deprecated:: 1.4 The :paramref:`_orm.relationship.cascade_backrefs` flag will default to False in all cases in SQLAlchemy 2.0. .. seealso:: :ref:`backref_cascade` - Full discussion and examples on how the :paramref:`_orm.relationship.cascade_backrefs` option is used. :param collection_class: A class or callable that returns a new list-holding object. will be used in place of a plain list for storing elements. .. seealso:: :ref:`custom_collections` - Introductory documentation and examples. :param comparator_factory: A class which extends :class:`.RelationshipProperty.Comparator` which provides custom SQL clause generation for comparison operations. .. seealso:: :class:`.PropComparator` - some detail on redefining comparators at this level. :ref:`custom_comparators` - Brief intro to this feature. :param distinct_target_key=None: Indicate if a "subquery" eager load should apply the DISTINCT keyword to the innermost SELECT statement. When left as ``None``, the DISTINCT keyword will be applied in those cases when the target columns do not comprise the full primary key of the target table. When set to ``True``, the DISTINCT keyword is applied to the innermost SELECT unconditionally. It may be desirable to set this flag to False when the DISTINCT is reducing performance of the innermost subquery beyond that of what duplicate innermost rows may be causing. .. versionchanged:: 0.9.0 - :paramref:`_orm.relationship.distinct_target_key` now defaults to ``None``, so that the feature enables itself automatically for those cases where the innermost query targets a non-unique key. .. seealso:: :ref:`loading_toplevel` - includes an introduction to subquery eager loading. :param doc: Docstring which will be applied to the resulting descriptor. :param foreign_keys: A list of columns which are to be used as "foreign key" columns, or columns which refer to the value in a remote column, within the context of this :func:`_orm.relationship` object's :paramref:`_orm.relationship.primaryjoin` condition. That is, if the :paramref:`_orm.relationship.primaryjoin` condition of this :func:`_orm.relationship` is ``a.id == b.a_id``, and the values in ``b.a_id`` are required to be present in ``a.id``, then the "foreign key" column of this :func:`_orm.relationship` is ``b.a_id``. In normal cases, the :paramref:`_orm.relationship.foreign_keys` parameter is **not required.** :func:`_orm.relationship` will automatically determine which columns in the :paramref:`_orm.relationship.primaryjoin` condition are to be considered "foreign key" columns based on those :class:`_schema.Column` objects that specify :class:`_schema.ForeignKey`, or are otherwise listed as referencing columns in a :class:`_schema.ForeignKeyConstraint` construct. :paramref:`_orm.relationship.foreign_keys` is only needed when: 1. There is more than one way to construct a join from the local table to the remote table, as there are multiple foreign key references present. Setting ``foreign_keys`` will limit the :func:`_orm.relationship` to consider just those columns specified here as "foreign". 2. The :class:`_schema.Table` being mapped does not actually have :class:`_schema.ForeignKey` or :class:`_schema.ForeignKeyConstraint` constructs present, often because the table was reflected from a database that does not support foreign key reflection (MySQL MyISAM). 3. The :paramref:`_orm.relationship.primaryjoin` argument is used to construct a non-standard join condition, which makes use of columns or expressions that do not normally refer to their "parent" column, such as a join condition expressed by a complex comparison using a SQL function. The :func:`_orm.relationship` construct will raise informative error messages that suggest the use of the :paramref:`_orm.relationship.foreign_keys` parameter when presented with an ambiguous condition. In typical cases, if :func:`_orm.relationship` doesn't raise any exceptions, the :paramref:`_orm.relationship.foreign_keys` parameter is usually not needed. :paramref:`_orm.relationship.foreign_keys` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a Python-evaluable string when using Declarative. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: :ref:`relationship_foreign_keys` :ref:`relationship_custom_foreign` :func:`.foreign` - allows direct annotation of the "foreign" columns within a :paramref:`_orm.relationship.primaryjoin` condition. :param info: Optional data dictionary which will be populated into the :attr:`.MapperProperty.info` attribute of this object. :param innerjoin=False: When ``True``, joined eager loads will use an inner join to join against related tables instead of an outer join. The purpose of this option is generally one of performance, as inner joins generally perform better than outer joins. This flag can be set to ``True`` when the relationship references an object via many-to-one using local foreign keys that are not nullable, or when the reference is one-to-one or a collection that is guaranteed to have one or at least one entry. The option supports the same "nested" and "unnested" options as that of :paramref:`_orm.joinedload.innerjoin`. See that flag for details on nested / unnested behaviors. .. seealso:: :paramref:`_orm.joinedload.innerjoin` - the option as specified by loader option, including detail on nesting behavior. :ref:`what_kind_of_loading` - Discussion of some details of various loader options. :param join_depth: When non-``None``, an integer value indicating how many levels deep "eager" loaders should join on a self-referring or cyclical relationship. The number counts how many times the same Mapper shall be present in the loading condition along a particular join branch. When left at its default of ``None``, eager loaders will stop chaining when they encounter a the same target mapper which is already higher up in the chain. This option applies both to joined- and subquery- eager loaders. .. seealso:: :ref:`self_referential_eager_loading` - Introductory documentation and examples. :param lazy='select': specifies How the related items should be loaded. Default value is ``select``. Values include: * ``select`` - items should be loaded lazily when the property is first accessed, using a separate SELECT statement, or identity map fetch for simple many-to-one references. * ``immediate`` - items should be loaded as the parents are loaded, using a separate SELECT statement, or identity map fetch for simple many-to-one references. * ``joined`` - items should be loaded "eagerly" in the same query as that of the parent, using a JOIN or LEFT OUTER JOIN. Whether the join is "outer" or not is determined by the :paramref:`_orm.relationship.innerjoin` parameter. * ``subquery`` - items should be loaded "eagerly" as the parents are loaded, using one additional SQL statement, which issues a JOIN to a subquery of the original statement, for each collection requested. * ``selectin`` - items should be loaded "eagerly" as the parents are loaded, using one or more additional SQL statements, which issues a JOIN to the immediate parent object, specifying primary key identifiers using an IN clause. .. versionadded:: 1.2 * ``noload`` - no loading should occur at any time. This is to support "write-only" attributes, or attributes which are populated in some manner specific to the application. * ``raise`` - lazy loading is disallowed; accessing the attribute, if its value were not already loaded via eager loading, will raise an :exc:`~sqlalchemy.exc.InvalidRequestError`. This strategy can be used when objects are to be detached from their attached :class:`.Session` after they are loaded. .. versionadded:: 1.1 * ``raise_on_sql`` - lazy loading that emits SQL is disallowed; accessing the attribute, if its value were not already loaded via eager loading, will raise an :exc:`~sqlalchemy.exc.InvalidRequestError`, **if the lazy load needs to emit SQL**. If the lazy load can pull the related value from the identity map or determine that it should be None, the value is loaded. This strategy can be used when objects will remain associated with the attached :class:`.Session`, however additional SELECT statements should be blocked. .. versionadded:: 1.1 * ``dynamic`` - the attribute will return a pre-configured :class:`_query.Query` object for all read operations, onto which further filtering operations can be applied before iterating the results. See the section :ref:`dynamic_relationship` for more details. * True - a synonym for 'select' * False - a synonym for 'joined' * None - a synonym for 'noload' .. seealso:: :doc:`/orm/loading_relationships` - Full documentation on relationship loader configuration. :ref:`dynamic_relationship` - detail on the ``dynamic`` option. :ref:`collections_noload_raiseload` - notes on "noload" and "raise" :param load_on_pending=False: Indicates loading behavior for transient or pending parent objects. When set to ``True``, causes the lazy-loader to issue a query for a parent object that is not persistent, meaning it has never been flushed. This may take effect for a pending object when autoflush is disabled, or for a transient object that has been "attached" to a :class:`.Session` but is not part of its pending collection. The :paramref:`_orm.relationship.load_on_pending` flag does not improve behavior when the ORM is used normally - object references should be constructed at the object level, not at the foreign key level, so that they are present in an ordinary way before a flush proceeds. This flag is not not intended for general use. .. seealso:: :meth:`.Session.enable_relationship_loading` - this method establishes "load on pending" behavior for the whole object, and also allows loading on objects that remain transient or detached. :param order_by: Indicates the ordering that should be applied when loading these items. :paramref:`_orm.relationship.order_by` is expected to refer to one of the :class:`_schema.Column` objects to which the target class is mapped, or the attribute itself bound to the target class which refers to the column. :paramref:`_orm.relationship.order_by` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a Python-evaluable string when using Declarative. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. :param passive_deletes=False: Indicates loading behavior during delete operations. A value of True indicates that unloaded child items should not be loaded during a delete operation on the parent. Normally, when a parent item is deleted, all child items are loaded so that they can either be marked as deleted, or have their foreign key to the parent set to NULL. Marking this flag as True usually implies an ON DELETE rule is in place which will handle updating/deleting child rows on the database side. Additionally, setting the flag to the string value 'all' will disable the "nulling out" of the child foreign keys, when the parent object is deleted and there is no delete or delete-orphan cascade enabled. This is typically used when a triggering or error raise scenario is in place on the database side. Note that the foreign key attributes on in-session child objects will not be changed after a flush occurs so this is a very special use-case setting. Additionally, the "nulling out" will still occur if the child object is de-associated with the parent. .. seealso:: :ref:`passive_deletes` - Introductory documentation and examples. :param passive_updates=True: Indicates the persistence behavior to take when a referenced primary key value changes in place, indicating that the referencing foreign key columns will also need their value changed. When True, it is assumed that ``ON UPDATE CASCADE`` is configured on the foreign key in the database, and that the database will handle propagation of an UPDATE from a source column to dependent rows. When False, the SQLAlchemy :func:`_orm.relationship` construct will attempt to emit its own UPDATE statements to modify related targets. However note that SQLAlchemy **cannot** emit an UPDATE for more than one level of cascade. Also, setting this flag to False is not compatible in the case where the database is in fact enforcing referential integrity, unless those constraints are explicitly "deferred", if the target backend supports it. It is highly advised that an application which is employing mutable primary keys keeps ``passive_updates`` set to True, and instead uses the referential integrity features of the database itself in order to handle the change efficiently and fully. .. seealso:: :ref:`passive_updates` - Introductory documentation and examples. :paramref:`.mapper.passive_updates` - a similar flag which takes effect for joined-table inheritance mappings. :param post_update: This indicates that the relationship should be handled by a second UPDATE statement after an INSERT or before a DELETE. This flag is used to handle saving bi-directional dependencies between two individual rows (i.e. each row references the other), where it would otherwise be impossible to INSERT or DELETE both rows fully since one row exists before the other. Use this flag when a particular mapping arrangement will incur two rows that are dependent on each other, such as a table that has a one-to-many relationship to a set of child rows, and also has a column that references a single child row within that list (i.e. both tables contain a foreign key to each other). If a flush operation returns an error that a "cyclical dependency" was detected, this is a cue that you might want to use :paramref:`_orm.relationship.post_update` to "break" the cycle. .. seealso:: :ref:`post_update` - Introductory documentation and examples. :param primaryjoin: A SQL expression that will be used as the primary join of the child object against the parent object, or in a many-to-many relationship the join of the parent object to the association table. By default, this value is computed based on the foreign key relationships of the parent and child tables (or association table). :paramref:`_orm.relationship.primaryjoin` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a Python-evaluable string when using Declarative. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: :ref:`relationship_primaryjoin` :param remote_side: Used for self-referential relationships, indicates the column or list of columns that form the "remote side" of the relationship. :paramref:`_orm.relationship.remote_side` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a Python-evaluable string when using Declarative. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: :ref:`self_referential` - in-depth explanation of how :paramref:`_orm.relationship.remote_side` is used to configure self-referential relationships. :func:`.remote` - an annotation function that accomplishes the same purpose as :paramref:`_orm.relationship.remote_side`, typically when a custom :paramref:`_orm.relationship.primaryjoin` condition is used. :param query_class: A :class:`_query.Query` subclass that will be used internally by the ``AppenderQuery`` returned by a "dynamic" relationship, that is, a relationship that specifies ``lazy="dynamic"`` or was otherwise constructed using the :func:`_orm.dynamic_loader` function. .. seealso:: :ref:`dynamic_relationship` - Introduction to "dynamic" relationship loaders. :param secondaryjoin: A SQL expression that will be used as the join of an association table to the child object. By default, this value is computed based on the foreign key relationships of the association and child tables. :paramref:`_orm.relationship.secondaryjoin` may also be passed as a callable function which is evaluated at mapper initialization time, and may be passed as a Python-evaluable string when using Declarative. .. warning:: When passed as a Python-evaluable string, the argument is interpreted using Python's ``eval()`` function. **DO NOT PASS UNTRUSTED INPUT TO THIS STRING**. See :ref:`declarative_relationship_eval` for details on declarative evaluation of :func:`_orm.relationship` arguments. .. seealso:: :ref:`relationship_primaryjoin` :param single_parent: When True, installs a validator which will prevent objects from being associated with more than one parent at a time. This is used for many-to-one or many-to-many relationships that should be treated either as one-to-one or one-to-many. Its usage is optional, except for :func:`_orm.relationship` constructs which are many-to-one or many-to-many and also specify the ``delete-orphan`` cascade option. The :func:`_orm.relationship` construct itself will raise an error instructing when this option is required. .. seealso:: :ref:`unitofwork_cascades` - includes detail on when the :paramref:`_orm.relationship.single_parent` flag may be appropriate. :param uselist: A boolean that indicates if this property should be loaded as a list or a scalar. In most cases, this value is determined automatically by :func:`_orm.relationship` at mapper configuration time, based on the type and direction of the relationship - one to many forms a list, many to one forms a scalar, many to many is a list. If a scalar is desired where normally a list would be present, such as a bi-directional one-to-one relationship, set :paramref:`_orm.relationship.uselist` to False. The :paramref:`_orm.relationship.uselist` flag is also available on an existing :func:`_orm.relationship` construct as a read-only attribute, which can be used to determine if this :func:`_orm.relationship` deals with collections or scalar attributes:: >>> User.addresses.property.uselist True .. seealso:: :ref:`relationships_one_to_one` - Introduction to the "one to one" relationship pattern, which is typically when the :paramref:`_orm.relationship.uselist` flag is needed. :param viewonly=False: When set to ``True``, the relationship is used only for loading objects, and not for any persistence operation. A :func:`_orm.relationship` which specifies :paramref:`_orm.relationship.viewonly` can work with a wider range of SQL operations within the :paramref:`_orm.relationship.primaryjoin` condition, including operations that feature the use of a variety of comparison operators as well as SQL functions such as :func:`_expression.cast`. The :paramref:`_orm.relationship.viewonly` flag is also of general use when defining any kind of :func:`_orm.relationship` that doesn't represent the full set of related objects, to prevent modifications of the collection from resulting in persistence operations. When using the :paramref:`_orm.relationship.viewonly` flag in conjunction with backrefs, the originating relationship for a particular state change will not produce state changes within the viewonly relationship. This is the behavior implied by :paramref:`_orm.relationship.sync_backref` being set to False. .. versionchanged:: 1.3.17 - the :paramref:`_orm.relationship.sync_backref` flag is set to False when using viewonly in conjunction with backrefs. .. seealso:: :paramref:`_orm.relationship.sync_backref` :param sync_backref: A boolean that enables the events used to synchronize the in-Python attributes when this relationship is target of either :paramref:`_orm.relationship.backref` or :paramref:`_orm.relationship.back_populates`. Defaults to ``None``, which indicates that an automatic value should be selected based on the value of the :paramref:`_orm.relationship.viewonly` flag. When left at its default, changes in state will be back-populated only if neither sides of a relationship is viewonly. .. versionadded:: 1.3.17 .. versionchanged:: 1.4 - A relationship that specifies :paramref:`_orm.relationship.viewonly` automatically implies that :paramref:`_orm.relationship.sync_backref` is ``False``. .. seealso:: :paramref:`_orm.relationship.viewonly` :param omit_join: Allows manual control over the "selectin" automatic join optimization. Set to ``False`` to disable the "omit join" feature added in SQLAlchemy 1.3; or leave as ``None`` to leave automatic optimization in place. .. note:: This flag may only be set to ``False``. It is not necessary to set it to ``True`` as the "omit_join" optimization is automatically detected; if it is not detected, then the optimization is not supported. .. versionchanged:: 1.3.11 setting ``omit_join`` to True will now emit a warning as this was not the intended use of this flag. .. versionadded:: 1.3 R(R)R*R+R,s-sync_backref and viewonly cannot both be Truessetting omit_join to True is not supported; selectin loading of this relationship may not work correctly if this flag is set explicitly. omit_join optimization is automatically detected for conditions under which it is supported.tlazys\s*,\s*tmergessave-update, mergesCbackref and back_populates keyword arguments are mutually exclusiveN(6tsuperR&t__init__tuselisttargumentt secondaryt primaryjoint secondaryjoint post_updatetNonet directiontviewonlyt _warn_for_persistence_only_flagstsa_exct ArgumentErrort sync_backrefR.t single_parentt_user_defined_foreign_keystcollection_classR(R,R)t remote_sideR*t query_classt innerjointdistinct_target_keytdocR+t_legacy_inactive_history_stylet join_depthRtwarnt omit_jointlocal_remote_pairst bake_queriestload_on_pendingt Comparatortcomparator_factoryt comparatortset_creation_ordertinfot strategy_keytsett_reverse_propertytretsplitt _overlapstFalsetcascadetorder_bytback_populatestbackref($tselfR3R4R5R6t foreign_keysR2R[R]R\toverlapsR7RZR:R.RAR(R)RBR*RHROR?RDRERFR+R,RMRLt_local_remote_pairsRCRRRJR>RG((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR1ys[                                                 cK@sKxD|jD]6\}}||j|kr tjd|fq q WdS(NsSetting %s on relationship() while also setting viewonly=True does not make sense, as a viewonly=True relationship does not perform persistence operations. This configuration may raise an error in a future release.(titemst_persistence_onlyRRI(R^tkwtktv((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR;,s c C@s;tj|j|jd|j||d|d|jdS(NRPt parententityRF(Rtregister_descriptortclass_tkeyRORF(R^tmapper((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytinstrument_class>s  RNcB@seZdZdZdZddddZdZej dZ ej dZ ej dZ dZ dZdZd Zd ZdZd Zdd Zdd ZddZdZdZdZej dZRS(sProduce boolean, comparison, and other operators for :class:`.RelationshipProperty` attributes. See the documentation for :class:`.PropComparator` for a brief overview of ORM level operator definition. .. seealso:: :class:`.PropComparator` :class:`.ColumnProperty.Comparator` :class:`.ColumnOperators` :ref:`types_operators` :attr:`.TypeEngine.comparator_factory` cC@s:||_||_||_|r-||_n||_dS(sConstruction of :class:`.RelationshipProperty.Comparator` is internal to the ORM's attribute mechanics. N(tpropt _parententityt_adapt_to_entityt_of_typet_extra_criteria(R^Rmt parentmappertadapt_to_entitytof_typetextra_criteria((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR1_s    cC@s%|j|j|jd|d|jS(NRsRt(t __class__tpropertyRnRp(R^Rs((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRsrs  cC@s*|jdk rt|jS|jjSdS(s+The target entity referred to by this :class:`.RelationshipProperty.Comparator`. This is either a :class:`_orm.Mapper` or :class:`.AliasedInsp` object. This is the "target" or "remote" side of the :func:`_orm.relationship`. N(RpR8RRwtentity(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRxzs cC@s |jjS(sThe target :class:`_orm.Mapper` referred to by this :class:`.RelationshipProperty.Comparator`. This is the "target" or "remote" side of the :func:`_orm.relationship`. (RwRk(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRks cC@s |jjS(N(Rwtparent(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRnscC@s$|jr|jjS|jjjSdS(N(Rot selectableRwRyt_with_polymorphic_selectable(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_source_selectables  c C@s|j}|jr't|j}nd}|jjd|dtd|dtd|j\}}}}}}|dk r||@S|SdS(Ntsource_selectabletsource_polymorphictof_type_entitytalias_secondaryRu(R|RpRR8Rwt _create_joinsR#Rq( R^t adapt_fromRtpjtsjtsourcetdestR4ttarget_adapter((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__clause_element__s    c C@s.tj|j|jd|jd|d|jS(sRedefine this object in terms of a polymorphic subclass. See :meth:`.PropComparator.of_type` for an example. RsRtRu(R&RNRwRnRoRq(R^tcls((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRts   c G@s5tj|j|jd|jd|jd|j|S(sAdd AND criteria. See :meth:`.PropComparator.and_` for an example. .. versionadded:: 1.4 RsRtRu(R&RNRwRnRoRpRq(R^tother((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytand_s    cC@stddS(sProduce an IN clause - this is not implemented for :func:`_orm.relationship`-based attributes at this time. svin_() not yet supported for relationships. For a simple many-to-one, use in_() against the set of foreign key values.N(tNotImplementedError(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytin_scC@st|tjtjfr`|jjttgkr>|j St |jj dd|j Sn=|jjr~tjdnt |jj |d|j SdS(sImplement the ``==`` operator. In a many-to-one context, such as:: MyClass.some_prop == this will typically produce a clause such as:: mytable.related_id == Where ```` is the primary key of the given object. The ``==`` operator provides partial functionality for non- many-to-one comparisons: * Comparisons against collections are not supported. Use :meth:`~.RelationshipProperty.Comparator.contains`. * Compared to a scalar one-to-many, will produce a clause that compares the target columns in the parent to the given target. * Compared to a scalar many-to-many, an alias of the association table will be rendered as well, forming a natural join that is part of the main body of the query. This will not work for queries that go beyond simple AND conjunctions of comparisons, such as those which use OR. Use explicit joins, outerjoins, or :meth:`~.RelationshipProperty.Comparator.has` for more comprehensive non-many-to-one scalar membership tests. * Comparisons against ``None`` given in a one-to-many or many-to-many context produce a NOT EXISTS clause. t adapt_sources]Can't compare a collection to an object or collection; use contains() to test for membership.N(t isinstanceRtNoneTypeRtNullRwR9RRt_criterion_existsR t_optimized_compareR8tadapterR2R<tInvalidRequestError(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__eq__s%     cK@sMt|ddrt|j}|j|j|j}}}|jjr`| r`|j }n|j }|dk r|dk r||@}q|}qn t }d}|j r|j }nd}|jjd|d|\} } } } } }xO|D]G}t|jjj|||k}|dkr5|}q||@}qW| dk rbt| | @}nt| d|jj}|dk r|r| r|j|}n|dk r|jitd6}n|tjj|@}| dk rtjdj|j| | j| | }n*tjdj|j| j| }|S(NRptdest_selectableR}texcludetno_replacement_traversei(tgetattrR8RRpRkRztis_aliased_classRwt_is_self_referentialt_anonymous_fromclauset_single_table_criterionRYRR|RRiR RBttraverset _annotateR#RtTrue_t_ifnonetexiststwheret select_fromtcorrelate_except(R^t criteriontkwargsRRt target_mappert to_selectableRt single_critR}RRRRR4RRetcrittjtex((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR$s\        "           cK@s.|jjstjdn|j||S(ssProduce an expression that tests a collection against particular criterion, using EXISTS. An expression like:: session.query(MyClass).filter( MyClass.somereference.any(SomeRelated.x==2) ) Will produce a query like:: SELECT * FROM my_table WHERE EXISTS (SELECT 1 FROM related WHERE related.my_id=my_table.id AND related.x=2) Because :meth:`~.RelationshipProperty.Comparator.any` uses a correlated subquery, its performance is not nearly as good when compared against large target tables as that of using a join. :meth:`~.RelationshipProperty.Comparator.any` is particularly useful for testing for empty collections:: session.query(MyClass).filter( ~MyClass.somereference.any() ) will produce:: SELECT * FROM my_table WHERE NOT (EXISTS (SELECT 1 FROM related WHERE related.my_id=my_table.id)) :meth:`~.RelationshipProperty.Comparator.any` is only valid for collections, i.e. a :func:`_orm.relationship` that has ``uselist=True``. For scalar references, use :meth:`~.RelationshipProperty.Comparator.has`. s9'any()' not implemented for scalar attributes. Use has().(RwR2R<RR(R^RR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytany}s)  cK@s.|jjrtjdn|j||S(sProduce an expression that tests a scalar reference against particular criterion, using EXISTS. An expression like:: session.query(MyClass).filter( MyClass.somereference.has(SomeRelated.x==2) ) Will produce a query like:: SELECT * FROM my_table WHERE EXISTS (SELECT 1 FROM related WHERE related.id==my_table.related_id AND related.x=2) Because :meth:`~.RelationshipProperty.Comparator.has` uses a correlated subquery, its performance is not nearly as good when compared against large target tables as that of using a join. :meth:`~.RelationshipProperty.Comparator.has` is only valid for scalar references, i.e. a :func:`_orm.relationship` that has ``uselist=False``. For collection references, use :meth:`~.RelationshipProperty.Comparator.any`. s4'has()' not implemented for collections. Use any().(RwR2R<RR(R^RR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pythass  cK@sd|jjstjdn|jj|d|j}|jjdk r`|j||_ n|S(s Return a simple expression that tests a collection for containment of a particular item. :meth:`~.RelationshipProperty.Comparator.contains` is only valid for a collection, i.e. a :func:`_orm.relationship` that implements one-to-many or many-to-many with ``uselist=True``. When used in a simple one-to-many context, an expression like:: MyClass.contains(other) Produces a clause like:: mytable.id == Where ```` is the value of the foreign key attribute on ``other`` which refers to the primary key of its parent object. From this it follows that :meth:`~.RelationshipProperty.Comparator.contains` is very useful when used with simple one-to-many operations. For many-to-many operations, the behavior of :meth:`~.RelationshipProperty.Comparator.contains` has more caveats. The association table will be rendered in the statement, producing an "implicit" join, that is, includes multiple tables in the FROM clause which are equated in the WHERE clause:: query(MyClass).filter(MyClass.contains(other)) Produces a query like:: SELECT * FROM my_table, my_association_table AS my_association_table_1 WHERE my_table.id = my_association_table_1.parent_id AND my_association_table_1.child_id = Where ```` would be the primary key of ``other``. From the above, it is clear that :meth:`~.RelationshipProperty.Comparator.contains` will **not** work with many-to-many collections when used in queries that move beyond simple AND conjunctions, such as multiple :meth:`~.RelationshipProperty.Comparator.contains` expressions joined by OR. In such cases subqueries or explicit "outer joins" will need to be used instead. See :meth:`~.RelationshipProperty.Comparator.any` for a less-performant alternative using EXISTS, or refer to :meth:`_query.Query.outerjoin` as well as :ref:`orm_queryguide_joins` for more details on constructing outer joins. kwargs may be ignored by this operator but are required for API conformance. s9'contains' not implemented for scalar attributes. Use ==RN( RwR2R<RRRR6R8t'_Comparator__negated_contains_or_equalstnegation_clause(R^RRtclause((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytcontainss;   c @s jjtkrtj|}fd}fd}jjrtjgjjD]H\}}tj |||||||k||dk^q^Sntjgt jj j jj j|D]\}}||k^q}j|S(Nc @sI|j}tj|jd|jdtdjjjj|||S(Nttype_tuniquet callable_( tdictRt bindparamRjttypeR#Rwt_get_attr_w_warn_on_noneRk(t local_coltstatet remote_coltdict_(R^(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytstate_bindparams    c@sjrj|S|SdS(N(R(tcol(R^(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytadapt*s  (RwR9RRtinstance_statet_use_getRRRKtor_R8tzipRkt primary_keytprimary_key_from_instanceR(R^RRRRtxtyR((R^sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__negated_contains_or_equalss  \ 7cC@st|tjtjfrZ|jjtkrMt|jj dd|j S|j Sn1|jj rxtjdnt|j|SdS(s"Implement the ``!=`` operator. In a many-to-one context, such as:: MyClass.some_prop != This will typically produce a clause such as:: mytable.related_id != Where ```` is the primary key of the given object. The ``!=`` operator provides partial functionality for non- many-to-one comparisons: * Comparisons against collections are not supported. Use :meth:`~.RelationshipProperty.Comparator.contains` in conjunction with :func:`_expression.not_`. * Compared to a scalar one-to-many, will produce a clause that compares the target columns in the parent to the given target. * Compared to a scalar many-to-many, an alias of the association table will be rendered as well, forming a natural join that is part of the main body of the query. This will not work for queries that go beyond simple AND conjunctions of comparisons, such as those which use OR. Use explicit joins, outerjoins, or :meth:`~.RelationshipProperty.Comparator.has` in conjunction with :func:`_expression.not_` for more comprehensive non-many-to-one scalar membership tests. * Comparisons against ``None`` given in a one-to-many or many-to-many context produce an EXISTS clause. Rs]Can't compare a collection to an object or collection; use contains() to test for membership.N(RRRRRRwR9RR RR8RRR2R<RR(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__ne__Hs'    cC@s|jjj|jS(N(RmRyt_check_configure(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRwsN(((t__name__t __module__t__doc__R8RpRqR1RsRtmemoized_propertyRxRkRnR|RRtRRt__hash__RRRRRRRRw(((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRNGs0        : Y 1 " K - :cC@sj|dk std}|dk rKt|}|jrK|jj}qKn|j|dtd|d|S(Ntvalue_is_parentRR(R8tAssertionErrorRRt_adaptert adapt_clauseRR#(R^tinstanceRt from_entityRtinsp((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt _with_parents   c@sdk rqytWntjk r8dnXdksXtdt rqtjdqqn| }dkrj|d|S|sjj jj }njj jj }|rj n jtjjfd}jdk rS|rStjjj|}ntj|ii|d6}|r||}n|S(Nt is_instancesMapped instance expected for relationship comparison to object. Classes, queries and other SQL elements are not accepted in this context; for comparison with a subquery, use %s.has(**criteria).Rc@s8|jkr4j|j|_ndS(N(t_identifying_keyRtcallable(R(t bind_to_colRRkR^R(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytvisit_bindparams R(R8RR<tNoInspectionAvailableRRYR=t_lazy_none_clauset_lazy_strategyt _lazywheret _bind_to_colt_rev_lazywheret_rev_bind_to_colRkRyRt instance_dicttobjR4RRRRtcloned_traverse(R^RRRRtreverse_directionRR((RRRkR^RsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRs@          c@s>jjjfd}|S(sKCreate the callable that is used in a many-to-one expression. E.g.:: u1 = s.query(User).get(5) expr = Address.user == u1 Above, the SQL should be "address.user_id = 5". The callable returned by this method produces the value "5" based on the identity of ``u1``. c@sjj}}|tjk }jdjrGtjn tjtjA}|tj kr|st j dt fqn@|tj kr|st j dt fqn|}|dkrtjdn|S(NtpassivesUCan't resolve value for column %s on object %s; no value has been set for this columns`Can't resolve value for column %s on object %s; the object is detached and the value was expiredsGot None for value of column %s; this is unsupported for a relationship comparison and will not currently produce an IS comparison (but may in a future release)(t_last_known_valuesRjRtNO_VALUEt_get_state_attr_by_columnt persistentt PASSIVE_OFFtPASSIVE_NO_FETCHtINIT_OKt NEVER_SETR<RRtPASSIVE_NO_RESULTR8RRI(t last_knownt to_returntexisting_is_availablet current_value(tcolumnRRkRmR(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_go s0  (tget_property_by_columnt_track_last_known_valueRj(R^RkRRRR((RRRkRmRsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRs+*cC@sc|s"|jj|jj}}n|jj|jj}}t||}|r_||}n|S(N(RRRRRR(R^RRRR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR7s  cC@st|jjjd|jS(Nt.(tstrRyRiRRj(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__str__Isc  C@sr|r3x*|jD]} || f|krdSqWnd|jkrFdS|j|krYdS|jr|j|j} | j||} | jr| j ntst |r|j|jj ||dt ng} x|| D]t} t j | }t j| }t|||f<|j||d|d|d|}|dk r| j|qqW|st j|||j}xI| D]}|j|qzWqn|j|jj||| dtdt n||j} | dk r0t j | }t j| }t|||f<|j||d|d|d|}nd}|sL|||j(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_effective_sync_backrefs cC@s`|jr.|jr.tjd||fn|jr\|j r\|jtk r\t|_ndS(NsQRelationship %s cannot specify sync_backref=True since %s includes viewonly=True.(R:R>R<RRY(trel_atrel_b((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_check_sync_backrefs  cC@s |jj|dt}t|tsCtjd||fn|j|||j|||jj ||jj ||jj |j stj d||||j fn|j ttfkr|j |j krtj d|||j fndS(Nt_configure_mapperssback_populates on relationship '%s' refers to attribute '%s' that is not a relationship. The back_populates parameter should refer to the name of a relationship on the target class.sereverse_property %r on relationship %s references relationship %s, which does not reference mapper %ssv%s and back-reference %s are both of the same direction %r. Did you mean to set remote_side on the many-to-one side ?(Rkt get_propertyRYRR&R<RR/RUR%t common_parentRyR=R9RR(R^RjR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_add_reverse_property s$ssqlalchemy.orm.mappercC@stjj}t|jtjr9|j|j}nCt|jrst|jt|j f rs|j}n |j}t|tr|j |dt Syt |}Wnt jk rnXt|dr|St jd|jt|fdS(sReturn the target mapped entity, which is an inspect() of the class or aliased class that is referred towards. t configureRksErelationship '%s' expects a class or a mapper argument (received: %s)N(Rt preloadedt orm_mapperRR3t string_typest_clsregistry_resolve_nameRRtMappert class_mapperRYRR<RRR=Rj(R^t mapperlibR3Rx((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRx5s$  cC@s |jjS(sReturn the targeted :class:`_orm.Mapper` for this :class:`.RelationshipProperty`. This is a lazy-initializing static attribute. (RxRk(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRkZscC@s|j|j|j|j|j|j|j|j|jj t t |j |j d|_dS(NR.R-(R.R-((R.R-(t_check_conflictst_process_dependent_argumentst_setup_registry_dependenciest_setup_join_conditionst_check_cascade_settingsRt _post_initt_generate_backreft_join_conditiont"_warn_for_conflicting_sync_targetsR0R&tdo_initt _get_strategyR(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyREds       cC@s#|jjjj|jjjdS(N(RyRktregistryt_set_depends_onRx(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR>psc C@sxdD]}t||}t|tjrYt|||j|d|dkqt|rt| rt|||qqWxWdD]O}t||}|d k rt||t t j t j |d|qqW|jd k r#t|jr#tjd |j|fn|jtk ri|jd k ritd tj|jD|_ntjd tj|jD|_tjd tj|jD|_|jj|_d S(sConvert incoming configuration arguments to their proper form. Callables are resolved, ORM annotations removed. R[R5R6R4R@RBt favor_tablestargnamessecondary argument %s passed to to relationship() %s must be a Table object or other FROM clause; can't send a mapped class directly as rows in 'secondary' are persisted independently of a class that is mapped to that same table.cs@s*|] }tjtj|ddVqdS(RJR[N(RR!RR"(t.0R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys scs@s*|] }tjtj|ddVqdS(RJR_N(RR!RR"(RKR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys scs@s*|] }tjtj|ddVqdS(RJRBN(RR!RR"(RKR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys sN(R[R5R6R4R@RB(R5R6(RRRR7tsetattrt_clsregistry_resolve_argRRR8R RR!RR"R4R<R=R[RYttupletto_listt column_sett to_column_setR@RBRxtpersist_selectablettarget(R^tattrt attr_valuetval((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR=usP     c!C@s td|jjd|jjd|jjd|jjd|jd|jd|jd|jjd |j jd |j d |j d |j d |j d|d|j d|j|_}|j|_|j|_|j|_|j |_ |j|_ |j|_|j|_|j|_|j|_dS(Ntparent_persist_selectabletchild_persist_selectabletparent_local_selectabletchild_local_selectableR5R4R6tparent_equivalentstchild_equivalentstconsider_as_foreign_keysRKRBtself_referentialRmt support_synctcan_be_synced_fn(t JoinConditionRyRRRxt local_tableR5R4R6t_equivalent_columnsRkR@RKRBRR:t_columns_are_mappedRCR9tremote_columnst local_columnstsynchronize_pairstforeign_key_columnst_calculated_foreign_keystsecondary_synchronize_pairs(R^tjc((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR?s4                      cC@s |jdS(Ni(t_clsregistry_resolvers(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRMscC@s |jdS(Ni(Rl(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR8sssqlalchemy.orm.clsregistrycC@s"tjjj}||jj|S(N(RR5torm_clsregistryt _resolverRyRi(R^Rn((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRlscC@sxtjj}|jjrt|j|jjdtj|j  rtt j d|j |jjj |jjj fndS(sOTest that this relationship is legal, warn about inheritance conflicts.R4sAttempting to assign a new relationship '%s' to a non-primary mapper on class '%s'. New relationships can only be added to the primary mapper, i.e. the very first mapper created for class '%s' N( RR5R6Ryt non_primaryR:RiRYt has_propertyRjR<R=R(R^R;((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR<s   cC@s|jS(s\Return the current cascade setting for this :class:`.RelationshipProperty`. (R(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRZ scC@s|j|dS(N(t _set_cascade(R^RZ((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRZ scC@st|}|jr[t|jtj}|r[tjddjt|q[nd|j krz|j |n||_ |j r||j _ ndS(NssCascade settings "%s" apply to persistence operations and should not be combined with a viewonly=True relationship.s, Rk(R R:RTt differencet_viewonly_cascadesR<R=tjointsortedt__dict__R@Rt_dependency_processorRZ(R^RZt non_viewonly((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRq s      cC@s|jr|j r|jtks1|jtkrtjdi|d6|jtkrYdndd6|jjj d6|j jj d6dd n|j d krd |ksd |krtjd |n|jr|j j j j|j|jjfndS(NsFor %(direction)s relationship %(rel)s, delete-orphan cascade is normally configured only on the "one" side of a one-to-many relationship, and not on the "many" side of a many-to-one or many-to-many relationship. To force this relationship to allow a particular "%(relatedcls)s" object to be referred towards by only a single "%(clsname)s" object at a time via the %(rel)s relationship, which would allow delete-orphan cascade to take place in this direction, set the single_parent=True flag.trels many-to-ones many-to-manyR9tclsnamet relatedclstcodetbbf0tallR s delete-orphans^On %s, can't set passive_deletes='all' in conjunction with 'delete' or 'delete-orphan' cascade(t delete_orphanR?R9RRR<R=RyRiRRkR(tprimary_mappert_delete_orphansR Rj(R^RZ((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR@( s(      cC@s&|j|jko%|j|j|kS(saReturn True if this property will persist values on behalf of the given mapper. (Rjt relationships(R^Rk((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt _persists_forT scG@srxk|D]c}|jdk r7|jjj|r7qn|jjjj| r|jjj| rtSqWtS(sReturn True if all columns in the given collection are mapped by the tables referenced by this :class:`.Relationship`. N( R4R8Rtcontains_columnRyRRRSRYR#(R^tcolsR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRd_ s  c C@s<|jjrdS|jdk r|j rt|jtjrQ|ji}}n|j\}}|jj }|j st |j j |j}xI|D]>}|j|r|j rtjd|||fqqWn|jdk r$|jd|jj}|jd|jj}nB|jd|jj}|jdd}|rftjdn|jd|j}|jj } |jd|j|jd|j|jd |j|jd |j||_t| |j||d|d |j |} |j!|| n|jr8|j"|jndS( slInterpret the 'backref' instruction to create a :func:`_orm.relationship` complementary to this one.Ns]Error creating backref '%s' on relationship '%s': property of that name exists on mapper '%s'R5R6sOCan't assign 'secondaryjoin' on a backref against a non-secondary relationship.R_R:R7R)R>R\(#RyRoR]R8R\RRR7RkRtconcreteRTtiterate_to_roottuniontself_and_descendantsRpR<R=R4tpopRCtsecondaryjoin_minus_localtprimaryjoin_minus_localtprimaryjoin_reverse_remoteRR@t setdefaultR:R7R)R>R&Rjt_configure_propertyR3( R^t backref_keyRRktchecktmRRR_RyR'((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRBp s`        ssqlalchemy.orm.dependencycC@sUtjj}|jdkr0|jtk |_n|jsQ|jj ||_ ndS(N( RR5torm_dependencyR2R8R9RR:tDependencyProcessortfrom_relationshipRw(R^t dependency((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRA s    cC@s|j}|jS(sPmemoize the 'use_get' attribute of this RelationshipLoader's lazyloader.(Rtuse_get(R^tstrategy((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR s cC@s|jj|jS(N(RkR2Ry(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR scC@st}|r$|jdk r$t}n|dkrT|rT|jjrT|jj}qTn|r|j}|dkr|j}t}qn |j}|dkr|j j}|jjrt}n|j r|dkr|j }t}qn'||jjk s|jjrt}n|j } |pA|dk oA||jjk pA|j }|jj|||| |\} } } } }|dkr|jj}n|dkr|j j}n| | ||| | fS(N(RYR4R8R#Rytwith_polymorphicR{RkRzRxRRRt _is_subqueryRCt join_targetsRb(R^R~R}RRRRutaliasedt dest_mapperRR5R6R4R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR sX                     (8RRRtstrategy_wildcard_keyR#t inherit_cachet_links_to_entityRRYRcR8RwR1R;RlRRNRRRRRR/RRRR+RwR,t staticmethodR/R3RRtpreload_moduleRxRkRER>R=R?RMR8RlR<RZtsetterRqR@RRdRBRARRR(((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR&]s    B ? ^  _ 7 )$  R   ,  M c@s7fd|dk r-|}nd|S(Nc@s>t|tjr*|jj}n|jd|S(Ntclone(RRt ColumnClauseRtcopyt_copy_internals(telem(t annotationsR(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR# s(R8(telementR((RRsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR " s  Rac B@seZd&d&d&d&d&d&d&d&ed&edd ZdZdZdZe dZ e dZ e j dZdZe j d Ze j d Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$e%j&Z'dZ(e j dZ)e j d Z*e j d!Z+d"Z,d#Z-d&d'd$Z.ed%Z/RS((cG@stS(N(R#(R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytA tcC@s0||_||_||_||_||_| |_||_||_||_| |_ | |_ | |_ ||_ | |_ ||_||_|j|j|j|j|j|j|j|j|jt|jdk r|j|jtn|j|j|jdS(N(RWRYRXRZR[R\R5R6R4R]Rat _remote_sideRmR^R_R`t_determine_joinst_sanitize_joinst _annotate_fkst_annotate_remotet_annotate_localt_annotate_parentmappert _setup_pairst_check_foreign_colsR#R8RYt_determine_directiont_check_remote_sidet _log_joins(R^RWRXRYRZR5R4R6R[R\R]RKRBR^RmR_R`((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR10 s:                         cC@sP|jdkrdS|jj}|jd|j|j|jd|j|j|jd|jdjd|jD|jd|jdjd|jpgD|jd|jdjd |j D|jd |jdjd |j D|jd |jdjd |j D|jd|j|j dS(Ns%s setup primary join %ss%s setup secondary join %ss%s synchronize pairs [%s]t,cs@s%|]\}}d||fVqdS(s (%s => %s)N((RKtlR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys k ss#%s secondary synchronize pairs [%s]cs@s%|]\}}d||fVqdS(s (%s => %s)N((RKRR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys r ss%s local/remote pairs [%s]cs@s%|]\}}d||fVqdS(s (%s / %s)N((RKRR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys z ss%s remote columns [%s]cs@s|]}d|VqdS(s%sN((RKR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys ss%s local columns [%s]cs@s|]}d|VqdS(s%sN((RKR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys ss%s relationship direction %s( RmR8tloggerRRR5R6RtRgRjRKReRfR9(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRa s< cC@sFt|jdd|_|jdk rBt|jdd|_ndS(sbremove the parententity annotation from our join conditions which can leak in here based on some declarative patterns and maybe others. We'd want to remove "parentmapper" also, but apparently there's an exotic use case in _join_fixture_inh_selfref_w_entity that relies upon it being present, see :ticket:`3364`. tvaluesRgt proxy_keyN(RgR(RgR(RR5R6R8(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR s cC@s|jd k r7|jd kr7tjd|jny|jpFd }|jd k r|jd krt|j|jd|j d||_n|j d krt|j |jd|j d||_ qn9|j d krt|j |jd|j d||_ nWntj k r}|jd k rZtjtj d|j|jfd|qtjtj d|jd|nwtjk r}|jd k rtjtjd|j|jfd|qtjtjd|jd|nXd S( sDetermine the 'primaryjoin' and 'secondaryjoin' attributes, if not passed to the constructor already. This is based on analysis of the foreign key relationships between the parent and target mapped selectables. sMProperty %s specified with secondary join condition but no secondary argumentta_subsetR]s1Could not determine join condition between parent/child tables on relationship %s - there are no foreign keys linking these tables via secondary table '%s'. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify 'primaryjoin' and 'secondaryjoin' expressions.tfrom_sCould not determine join condition between parent/child tables on relationship %s - there are no foreign keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression.slCould not determine join condition between parent/child tables on relationship %s - there are multiple foreign key paths linking the tables via secondary table '%s'. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference from the secondary table to each of the parent and child tables.s'Could not determine join condition between parent/child tables on relationship %s - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table.N(R6R8R4R<R=RmR]RRXRZR5RWRYtNoForeignKeysErrorRtraise_tAmbiguousForeignKeysError(R^R]tnfetafe((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR sb            cC@st|jddS(NRtlocalR(RR(RR5(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR scC@st|jddS(NRRR(RR(RR6(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR scC@sU|jr(d}tj|ji|S|jrDt|jddSt|jSdS(s(Return the primaryjoin condition suitable for the "reverse" direction. If the primaryjoin was delivered here with pre-existing "remote" annotations, the local/remote annotations are reversed. Otherwise, the local/remote annotations are removed. cS@s|d|jkr<t|j}|d=t|d<|j|Sd|jkrxt|j}|d=t|d<|j|SdS(NRR(t _annotationsRR#t_with_annotations(RRf((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytreplace s   RRRN(RR(t_has_remote_annotationsRtreplacement_traverseR5t_has_foreign_annotationsR(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR s   cC@s8x1tj|iD]}||jkrtSqWtSdS(N(RtiterateRR#RY(R^Rt annotationR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_has_annotation/ scC@s|j|jdS(NR%(RR5(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR6 scC@s|j|jdS(NR(RR5(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR: scC@s1|jr dS|jr#|jn |jdS(sAnnotate the primaryjoin and secondaryjoin structures with 'foreign' annotations marking columns considered as foreign. N(RR]t_annotate_from_fk_listt_annotate_present_fks(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR> s    c@s[fd}tjji|_jdk rWtjji|_ndS(Nc@s'|jkr#|jitd6SdS(NR%(R]RR#(R(R^(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytcheck_fkM s(RRR5R6R8(R^R((R^sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRL s c@s|jdk r'tj|jjn tfdfd}tj|jii|d6|_|j dk rtj|j ii|d6|_ ndS(Nc@st|tjrMt|tjrM|j|r7|S|j|rM|Snr|kro|kro|S|kr|kr|SndS(N(RRtColumnt references(tatb(t secondarycols(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt is_foreign_ s$c@st|jtj s,t|jtj r0dSd|jjkrd|jjkr|j|j}|dk r|j|jr|jjit d6|_q|j|jr|jjit d6|_qqndS(NR%( RtleftRt ColumnElementtrightRR8tcompareRR#(tbinaryR(R(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt visit_binaryl s  R( R4R8RRPRRTRRR5R6(R^R((RRsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRY s  c@sU|j|jtgfd}tj|jii|d6dS(svReturn True if the join condition contains column comparisons where both columns are in both tables. c@s|j|j}}t|tjrt|tjrj|jrj|jrj|jrj|jrtd| r>t|_qtjd|jn:|rit|_n(|r{t|_ntjd|jdS(s[Determine if this relationship is one to many, many to one, many to many. RR%sDCan't determine relationship direction for relationship '%s' - foreign key columns within the join condition are present in both the parent and the child's mapped tables. Ensure that only those columns referring to a parent column are marked as foreign, either via the foreign() annotation or via the foreign_keys argument.sCan't determine relationship direction for relationship '%s' - foreign key columns are present in neither the parent nor the child's mapped tablesN(R6R8RR9RRPRWRRXt intersectionRhRR5RTRReRfRrRRR<R=Rm( R^t parentcolst targetcolst onetomany_fkt manytoone_fktonetomany_localRtmanytoone_localt self_equated((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR sB           cC@s/g|D]$\}}|j|jf^qS(sprovide deannotation for the various lists of pairs, so that using them in hashes doesn't incur high-overhead __eq__() comparisons against original columns mapped. (t _deannotate(R^RRR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt_deannotate_pairs* sc@sg}tjgg}fd}xKj|fj|fgD]+\}}|dkrjqLn|||qLWj_j|_j|_dS(Nc@s&fd}t||dS(Nc@sd|jkrCd|jkrCj|rCj||fnCd|jkrd|jkrj|rj||fn|jtjkrj||rd|jkrj||fqd|jkrj||fqndS(NRR%(RR`R%toperatorRteqR (RRR(RtlrpR^(sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR9 s (R(tjoincondRR(R R^(RsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytgo8 s( Rt OrderedSetR5R6R8RRKRgRj(R^t sync_pairstsecondary_sync_pairsR R R((R R^sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR3 s  c @sh|js dSxTg|jD]\}|f^qg|jD]\}|f^q?D]\}|jkrtji||j6|j sRcs@s|]\}}|jVqdS(N(Rj(RKRtfr((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys sR|tqzyx(R_RgRjt_track_overlapping_sync_targetstweakreftWeakKeyDictionaryRmRbRkt_dispose_calledRURjRXRyt is_siblingR2R RRIRtRu(R^Rt other_propst prop_to_fromRR((RsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRD` sJ %3 #      cC@s |jdS(NR(t_gather_join_annotations(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRe scC@s |jdS(NR(R(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRf scC@s |jdS(NR%(R(R^((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRh scC@sWt|j|j|}|jdk rI|j|j|j|nd|DS(NcS@sh|]}|jqS((R(RKR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pys s (RTRR5R6R8tupdate(R^Rts((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR scG@sGt|}tgtj|iD]}|j|jr"|^q"S(N(RTRRtissubsetR(R^RRR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR s  c C@st|itd6}|j|j|j}}}|dk re|dk rX||@}qe||@}n|r|dk r|tj|@}q|tj|@}n|r|dk rN|jdt}t |dt d} t |d|j j | } |dk r<t |dt dj t |d|j } n| j|}n^t |dt dd|j } |dk r| j t |dt dd|j nd} | j|}| p| } d| _nd} |||| |fS(s7Given a source and destination selectable, create a join between them. This takes into account aliasing the join clause to reference the appropriate corresponding columns in the target objects, as well as the extra child criterion, equivalent column sets, etc. Rtflatt exclude_fnRt equivalentsRN(RR#R5R6R4R8RRRRt_ColInAnnotationsR\tchainR[RR"( R^R}RRRRuR5R6R4tprimary_aliasizertsecondary_aliasizerR((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR s`              c @stjtj}|jdk rztjtx|jD]-\}}|j||f|||ks (Rt column_dictR6R8t collectionst defaultdicttlistRKR R5RRRR( R^Rtequated_columnsRRR+t lazywhereR6R((R(R)R*RsO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytcreate_lazy_clause:s4    N((0RRR8RYR#R1RRRRwRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRDReRfRhRRRR2(((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyRa/ sd (  i#   .      /      B T +  W  [R$cB@s&eZdZdZdZdZRS(s<Serializable object that tests for a name in c._annotations.tnamecC@s ||_dS(N(R3(R^R3((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR1uscC@s|j|jkS(N(R3R(R^R((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyt__call__xs(R3(RRRt __slots__R1R4(((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pyR$ps (2Rt __future__RR-RVRRRtbaseRRRt interfacesRRRRR RR R R R R<RRRt inspectionRRRRRRtsql.utilRRRRRRRRR%t class_loggerR&R tobjectRaR$(((sO/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/relationships.pytsl       E