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 @sfddlZddlZddlZddlmZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z dd lm Z dd lm Z dd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddl!m"Z"ddlmZ#ddlm$Z$dd lm%Z%dd!lm&Z&dd"lm'Z'ddlm Z(dd#lm)Z)dd$l*m+Z+dd%l,m-Z-e.d&d'd(d)d*d+d,d-fZ/d.e.fd/YZ0d0Z1d1e2d2Z3d3Z4d4e(j5fd5YZ6d6e7fd7YZ8d8eee#j9e fd9YZ:d:e7fd;YZ;d<efd=YZ<ej=e8d>ej=e:d?e>e>e?e?d@Z@e?e?e>e?e?e?e?e>dAZAejBdBee+e#j9e fdCYZCe>dDZDdEZEdFZFdGe%jGfdHYZHe>e?e?e>dIZIe>e?e>dJZJe>dKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdS(SiNi(t attributes(t_class_to_mapper(t _never_set(t _none_set(t attribute_str(t class_mapper(tInspectionAttr(t instance_str(t object_mapper(t object_state(tstate_attribute_str(tstate_class_str(t state_str(tCriteriaOption(tMapperProperty(tORMColumnsClauseRole(tORMEntityColumnsClauseRole(tORMFromClauseRole(tPropComparator(t PathRegistryi(tevent(texc(t inspection(tsql(tutil(t result_tuple(tbase(t coercions(t expression(tlambdas(troles(tvisitors(tSupportsCloneAnnotations(tColumnCollectiontdeletes delete-orphantalltmergetexpunges save-updatesrefresh-expiretnonetCascadeOptionscBsheZdZejdddgZeZdddddgZdZd Z d Z e d Z RS(sHKeeps track of the options sent to :paramref:`.relationship.cascade`R#R&s delete-orphanR%srefresh-expireR$t save_updateR"trefresh_expiret delete_orphancCskt|tjs|dkr+|j|St|}|j|jrtj ddj gt |j|jD]}t |^qqnd|kr|j |jnd|kr|jn|jdtjt|}d|k|_d|k|_d|k|_d|k|_d |k|_d |k|_|jrg|j rgtjd n|S( NsInvalid cascade option(s): %ss, R#R&s save-updateR"srefresh-expireR$R%s delete-orphans5The 'delete-orphan' cascade option requires 'delete'.(t isinstanceRt string_typestNonet from_stringtsett differencet_allowed_cascadestsa_exct ArgumentErrortjointsortedtreprtupdatet_add_w_all_cascadestcleartdiscardt frozensett__new__R'R(R"R)R$R%R*twarn(tclst value_listtvaluestxtself((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR<Ts4  5     cCs*ddjgt|D] }|^qS(NsCascadeOptions(%r)t,(R4R5(RBRA((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt__repr__yscCs;gtjd|pdD]}|r|^q}||S(Ns\s*,\s*t(tretsplit(R>targtcR@((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR.|s1(R(R"R)R$R%R*( t__name__t __module__t__doc__t all_cascadesR0R8R1t_viewonly_cascadest __slots__R<RDt classmethodR.(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR'@s % c sLsfdn|rfd}fd}fd}fd}nHfd}fd}fd}tj|d |d td ttj|d |d ttj|d |d td t|rHtj|d|d td tndS(sNRuns a validation method on an attribute value to be set or appended. cs|jj}|j|k S(N(tmanagertimpl(tstatet initiatorRR(tkey(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytdetect_is_backrefscsI|jtjk rAs(|| rA|j|tS|SdS(N(topRtOP_BULK_REPLACEtobjtFalse(RStvalueRT(RVtinclude_backrefsRUt validator(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytappendscsRs|| rN|j}g|D]}||t^q)|(ndS(N(RYRZ(RSR@RTRYR[(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytbulk_sets cs7s|| r/|j|tS|SdS(N(RYRZ(RSR[toldvalueRT(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytset_scs6s|| r2|j|tndS(N(RYtTrue(RSR[RT(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytremovescsF|jtjk r>s(|| r>|j|S|SdS(N(RWRRXRY(RSR[RT(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR^scsOs|| rK|j}g|D]}||^q)|(ndS(N(RY(RSR@RTRYR[(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR_s cs4s|| r,|j|S|SdS(N(RY(RSR[R`RT(RVR\RUR](sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRasR^trawtretvalt bulk_replaceR/RcN(RtlistenRb( tdescRUR]tinclude_removesR\R^R_RaRc((RVR\RUR]sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_validator_eventsstp_unionc stj}iix|D]}||}tjtj|dt}|||>> identity_key(MyClass, (1, 2)) (, (1, 2), None) :param class: mapped class (must be a positional argument) :param ident: primary key, may be a scalar or tuple argument. :param identity_token: optional identity token .. versionadded:: 1.2 added identity_token * ``identity_key(instance=instance)`` This form will produce the identity key for a given instance. The instance need not be persistent, only that its primary key attributes are populated (else the key will contain ``None`` for those missing values). E.g.:: >>> instance = MyClass(1, 2) >>> identity_key(instance=instance) (, (1, 2), None) In this form, the given instance is ultimately run though :meth:`_orm.Mapper.identity_key_from_instance`, which will have the effect of performing a database check for the corresponding row if the object is expired. :param instance: object instance (must be given as a keyword arg) * ``identity_key(class, row=row, identity_token=token)`` This form is similar to the class/tuple form, except is passed a database result row as a :class:`.Row` object. E.g.:: >>> row = engine.execute(\ text("select * from table where a=1 and b=2")\ ).first() >>> identity_key(MyClass, row=row) (, (1, 2), None) :param class: mapped class (must be a positional argument) :param row: :class:`.Row` row returned by a :class:`_engine.CursorResult` (must be given as a keyword arg) :param identity_token: optional identity token .. versionadded:: 1.2 added identity_token iitrowtidentiis1expected up to three positional arguments, got %stidentity_tokensunknown keyword arguments: %ss, tinstanceN(ii(R-tlentpopRmR2R3R4Rtidentity_key_from_primary_keyRtto_listtidentity_key_from_rowtkeysRtidentity_key_from_instance( targstkwargsRtlargstclass_RRtmapperR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt identity_keys:@         t ORMAdaptercBs,eZdZdeeedZdZRS(saColumnAdapter subclass which excludes adaptation of entities from non-matching mappers. c Cs}tj|}|j|_|j}|j}|r?||_n d|_tjj |||d|d|d|d|j dS(Ntadapt_requiredtallow_label_resolvetanonymize_labelst include_fn( RtinspectRt selectabletis_aliased_classt aliased_classR-Rt ColumnAdaptert__init__t _include_fn( RBtentityt equivalentsRRRtinfoRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs      cCs>|jjdd}| p=|j|jp=|jj|S(Nt parentmapper(t _annotationstgetR-tisaR(RBtelemR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRsN(RJRKRLR-RZRbRR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR~s  t AliasedClassc BseeZdZddeedddeed ZedZdZdZ dZ dZ RS( sRepresents an "aliased" form of a mapped class for usage with Query. The ORM equivalent of a :func:`~sqlalchemy.sql.expression.alias` construct, this object mimics the mapped class using a ``__getattr__`` scheme and maintains a reference to a real :class:`~sqlalchemy.sql.expression.Alias` object. A primary purpose of :class:`.AliasedClass` is to serve as an alternate within a SQL statement generated by the ORM, such that an existing mapped entity can be used in multiple contexts. A simple example:: # find all pairs of users with the same name user_alias = aliased(User) session.query(User, user_alias).\ join((user_alias, User.id > user_alias.id)).\ filter(User.name == user_alias.name) :class:`.AliasedClass` is also capable of mapping an existing mapped class to an entirely new selectable, provided this selectable is column- compatible with the existing mapped selectable, and it can also be configured in a mapping as the target of a :func:`_orm.relationship`. See the links below for examples. The :class:`.AliasedClass` object is constructed typically using the :func:`_orm.aliased` function. It also is produced with additional configuration when using the :func:`_orm.with_polymorphic` function. The resulting object is an instance of :class:`.AliasedClass`. This object implements an attribute scheme which produces the same attribute and method interface as the original mapped class, allowing :class:`.AliasedClass` to be compatible with any attribute technique which works on the original class, including hybrid attributes (see :ref:`hybrids_toplevel`). The :class:`.AliasedClass` can be inspected for its underlying :class:`_orm.Mapper`, aliased selectable, and other information using :func:`_sa.inspect`:: from sqlalchemy import inspect my_alias = aliased(MyClass) insp = inspect(my_alias) The resulting inspection object is an instance of :class:`.AliasedInsp`. .. seealso:: :func:`.aliased` :func:`.with_polymorphic` :ref:`relationship_aliased_class` :ref:`relationship_to_window_function` c  Cstj|} | j} t} |dkro| jrQ| jjrQ| jj}q| j j d|d|}n| jrt } nt || |||r|n| j |dk r|n| j|| || | |_d| jj|_dS(NRrtflatsAliasedClass_%s(RRRRZR-RRt _is_subqueryRt_with_polymorphic_selectablet_anonymous_fromclauseRbt AliasedInsptwith_polymorphic_mapperstpolymorphic_ont _aliased_inspRRJ(RBtmapped_class_or_acRRrRtadapt_on_namesRtwith_polymorphic_discriminatort base_aliastuse_mapper_pathtrepresents_outer_jointinspRt nest_adapters((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs4        cCs|j|}d|jjj|_||_|jrxH|jD]:}||k rAtj|}t ||jj|qAqAWn|S(NsAliasedClass_%s( R<RRRJRt_is_with_polymorphict_with_polymorphic_entitiesRt_reconstitute_from_aliased_insptsetattr(R>t aliased_inspRYtsub_aliased_insptent((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs     cCsy|jd}Wntk r-tnX|j}t||}t|drwt|drwtj|j|St|dr|j d|}nt|dr|j |}t |||n|S(NRt__call__t__self__t__get__tadapt_to_entity( t__dict__RmtAttributeErrort_targettgetattrthasattrRvt MethodTypet__func__RR-RR(RBRURttargettattr((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt __getattr__%s   cCst||}t|dr@t|dr@tj|j|St|drd|jd|}nt|drtj||_ |j |}t |||n|S(NRRRR( RRRvRRRR-tweakreftreft _weak_entityRR(RBRUt mapped_classRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_get_from_serializedBscCsdt||jjjfS(Ns(tidRRRJ(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRDWs cCs t|jS(N(tstrR(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt__str__]sN(( RJRKRLR-RZRRPRRRRDR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs9 (   RcBsReZdZdejjfdejjfdejjfdejjfdejjfdej j fdej jfgZ dZ e d ZeZejd Ze d Ze d Ze d ZdZdZddZdZejdZejdZejdZdZ dZ!dZ"RS(sProvide an inspection interface for an :class:`.AliasedClass` object. The :class:`.AliasedInsp` object is returned given an :class:`.AliasedClass` using the :func:`_sa.inspect` function:: from sqlalchemy import inspect from sqlalchemy.orm import aliased my_alias = aliased(MyMappedClass) insp = inspect(my_alias) Attributes on :class:`.AliasedInsp` include: * ``entity`` - the :class:`.AliasedClass` represented. * ``mapper`` - the :class:`_orm.Mapper` mapping the underlying class. * ``selectable`` - the :class:`_expression.Alias` construct which ultimately represents an aliased :class:`_schema.Table` or :class:`_expression.Select` construct. * ``name`` - the name of the alias. Also is used as the attribute name when returned in a result tuple from :class:`_query.Query`. * ``with_polymorphic_mappers`` - collection of :class:`_orm.Mapper` objects indicating all those mappers expressed in the select construct for the :class:`.AliasedClass`. * ``polymorphic_on`` - an alternate column or SQL expression which will be used as the "discriminator" for a polymorphic load. .. seealso:: :ref:`inspection_toplevel` Rrt_adapt_on_namest_use_mapper_pathRRRRc  s|j} |j} tj||_| |_||_|_|_||_||_ tj|pe||_ ||_ | |_ | |_ |r t|_||_g|_x|jD]e}|| k rt|j|d|dd|}t|j|jj||jj|jqqWnt|_| g|_tj|d| jddtdfd|jD|_| r|jj|j|_n|_| |_dS(NRRRRRtadapt_from_selectablescsh|]}s|jqS((R(t.0R(R(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pys s ( RRRRRRtpersist_selectablet local_tableRrRt _base_aliasRRt_nest_adaptersRbRRRRRRRJR^RRZRRt_equivalent_columnst_adaptertwrapRR(RBRt inspectedRRrRRRRRRRRRtpolyR((RsF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRsL                  cCs@|j}|dkr<tj|}tj||_n|S(N(RR-RRRR(RBR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs   cCs?|jji|jd6|d6|d6jidd6|d6S(NRt parententitytentity_namespacetormtcompile_state_plugintplugin_subject(Rt _annotateRt_set_propagate_attrs(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt__clause_element__s    cCs|jS(N(R(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRscCs |jjS(sUReturn the mapped class ultimately represented by this :class:`.AliasedInsp`.(RR(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRscCs$|jr|jjStj|SdS(N(RRt_path_registryRt per_mapper(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR s  cCsui |jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd 6|j d 6|j d 6S( NRRRRrRRRRRRR( RRRRrRRRRRRR(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt __getstate__s          c Cs[|j|d|d|d|d|d|d|d|d|d |d |d  dS( NRRRRrRRRRRRR(R(RBRS((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt __setstate__ scCsZi|d6|jd6}|r*||ds  cs>jj\}}jj|fd|jDfS(Ncs+i|]!\}}|jj|qS((RR(RRwtparam(RB(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pys Rs (Rt _get_clauseRRR~(RBtonclauset replacemap((RBsF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRLs cCsiS(N((RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_memoized_valuesWscCs~|jr7|jjg|jD]}|j^q}n|jj}g|D]!\}}||j|f^qM}t|S(N(RRt_columns_plus_keysRRR!(RBRtcols_plus_keysRURw((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_all_column_expressions[s   %.cOs<||jkr|j|S||||j|<}|SdS(N(R(RBRUt callable_RtkwR[((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_memojs cCsO|jr,ddjd|jD}nd}dt||jj|fS(Ns(%s)s, css|]}|jjVqdS(N(RRJ(Rtmp((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pys tsREs(RR4RRRJ(RBt with_poly((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRDqs    csNjr9djjdjfdjDfSdjjfSdS(Nswith_polymorphic(%s, [%s])s, c3s*|] }|jk r|jjVqdS(N(RRRJ(RR (RB(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pys ss aliased(%s)(RRRJR4R(RB((RBsF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR~s   N(#RJRKRLRtExtendedInternalTraversalt dp_stringt dp_booleantdp_inspectabletdp_clauseelementtInternalTraversaltdp_has_cache_key_listt_cache_key_traversalRtpropertyRRbRRtmemoized_instancemethodRRRRRRR-RRtmemoized_propertyRRRR RDR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRas4*  I        t_WrapUserEntitycBs5eZdZdZdZejddZRS(sA wrapper used within the loader_criteria lambda caller so that we can bypass declared_attr descriptors on unmapped mixins, which normally emit a warning for such use. might also be useful for other per-lambda instrumentations should the need arise. tsubjectcCs ||_dS(N(R(RBR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRsssqlalchemy.orm.decl_apicCsntjjj}tj|d}||jkr]t|j||jr]|j|j |St ||SdS(NR( Rt preloadedRtdecl_apitobjectt__getattribute__RR+t declared_attrtfgetR(RBRrRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs (R(RJRKRLRORRtpreload_moduleR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs tLoaderCriteriaOptioncBseZdZdejjfdejjfdejjfdejj fdejj fgZ e e e e dZ edZdZd Zd Zd Zd Zd ZdZRS(s Add additional WHERE criteria to the load for all occurrences of a particular entity. :class:`_orm.LoaderCriteriaOption` is invoked using the :func:`_orm.with_loader_criteria` function; see that function for details. .. versionadded:: 1.4 t root_entityRtwhere_criteriatinclude_aliasestpropagate_to_loadersc Cstj|t}|dkr3||_d|_nd|_||_||_t|rt|_ t j |t j dt|jdk r|jn |jjfdt jd||_n!t|_ tjt j ||_||_||_dS(sV Add additional WHERE criteria to the load for all occurrences of a particular entity. .. versionadded:: 1.4 The :func:`_orm.with_loader_criteria` option is intended to add limiting criteria to a particular kind of entity in a query, **globally**, meaning it will apply to the entity as it appears in the SELECT query as well as within any subqueries, join conditions, and relationship loads, including both eager and lazy loaders, without the need for it to be specified in any particular part of the query. The rendering logic uses the same system used by single table inheritance to ensure a certain discriminator is applied to a table. E.g., using :term:`2.0-style` queries, we can limit the way the ``User.addresses`` collection is loaded, regardless of the kind of loading used:: from sqlalchemy.orm import with_loader_criteria stmt = select(User).options( selectinload(User.addresses), with_loader_criteria(Address, Address.email_address != 'foo')) ) Above, the "selectinload" for ``User.addresses`` will apply the given filtering criteria to the WHERE clause. Another example, where the filtering will be applied to the ON clause of the join, in this example using :term:`1.x style` queries:: q = session.query(User).outerjoin(User.addresses).options( with_loader_criteria(Address, Address.email_address != 'foo')) ) The primary purpose of :func:`_orm.with_loader_criteria` is to use it in the :meth:`_orm.SessionEvents.do_orm_execute` event handler to ensure that all occurrences of a particular entity are filtered in a certain way, such as filtering for access control roles. It also can be used to apply criteria to relationship loads. In the example below, we can apply a certain set of rules to all queries emitted by a particular :class:`_orm.Session`:: session = Session(bind=engine) @event.listens_for("do_orm_execute", session) def _add_filtering_criteria(execute_state): if ( execute_state.is_select and not execute_state.is_column_load and not execute_state.is_relationship_load ): execute_state.statement = execute_state.statement.options( with_loader_criteria( SecurityRole, lambda cls: cls.role.in_(['some_role']), include_aliases=True ) ) In the above example, the :meth:`_orm.SessionEvents.do_orm_execute` event will intercept all queries emitted using the :class:`_orm.Session`. For those queries which are SELECT statements and are not attribute or relationship loads a custom :func:`_orm.with_loader_criteria` option is added to the query. The :func:`_orm.with_loader_criteria` option will be used in the given statement and will also be automatically propagated to all relationship loads that descend from this query. The criteria argument given is a ``lambda`` that accepts a ``cls`` argument. The given class will expand to include all mapped subclass and need not itself be a mapped class. .. tip:: When using :func:`_orm.with_loader_criteria` option in conjunction with the :func:`_orm.contains_eager` loader option, it's important to note that :func:`_orm.with_loader_criteria` only affects the part of the query that determines what SQL is rendered in terms of the WHERE and FROM clauses. The :func:`_orm.contains_eager` option does not affect the rendering of the SELECT statement outside of the columns clause, so does not have any interaction with the :func:`_orm.with_loader_criteria` option. However, the way things "work" is that :func:`_orm.contains_eager` is meant to be used with a query that is already selecting from the additional entities in some way, where :func:`_orm.with_loader_criteria` can apply it's additional criteria. In the example below, assuming a mapping relationship as ``A -> A.bs -> B``, the given :func:`_orm.with_loader_criteria` option will affect the way in which the JOIN is rendered:: stmt = select(A).join(A.bs).options( contains_eager(A.bs), with_loader_criteria(B, B.flag == 1) ) Above, the given :func:`_orm.with_loader_criteria` option will affect the ON clause of the JOIN that is specified by ``.join(A.bs)``, so is applied as expected. The :func:`_orm.contains_eager` option has the effect that columns from ``B`` are added to the columns clause:: SELECT b.id, b.a_id, b.data, b.flag, a.id AS id_1, a.data AS data_1 FROM a JOIN b ON a.id = b.a_id AND b.flag = :flag_1 The use of the :func:`_orm.contains_eager` option within the above statement has no effect on the behavior of the :func:`_orm.with_loader_criteria` option. If the :func:`_orm.contains_eager` option were omitted, the SQL would be the same as regards the FROM and WHERE clauses, where :func:`_orm.with_loader_criteria` continues to add its criteria to the ON clause of the JOIN. The addition of :func:`_orm.contains_eager` only affects the columns clause, in that additional columns against ``b`` are added which are then consumed by the ORM to produce ``B`` instances. .. warning:: The use of a lambda inside of the call to :func:`_orm.with_loader_criteria` is only invoked **once per unique class**. Custom functions should not be invoked within this lambda. See :ref:`engine_lambda_caching` for an overview of the "lambda SQL" feature, which is for advanced use only. :param entity_or_base: a mapped class, or a class that is a super class of a particular set of mapped classes, to which the rule will apply. :param where_criteria: a Core SQL expression that applies limiting criteria. This may also be a "lambda:" or Python function that accepts a target class as an argument, when the given class is a base with many different mapped subclasses. .. note:: To support pickling, use a module-level Python function to produce the SQL expression instead of a lambda or a fixed SQL expression, which tend to not be picklable. :param include_aliases: if True, apply the rule to :func:`_orm.aliased` constructs as well. :param propagate_to_loaders: defaults to True, apply to relationship loaders such as lazy loaders. This indicates that the option object itself including SQL expression is carried along with each loaded instance. Set to ``False`` to prevent the object from being assigned to individual instances. .. seealso:: :ref:`examples_session_orm_events` - includes examples of using :func:`_orm.with_loader_criteria`. :ref:`do_orm_execute_global_criteria` - basic example on how to combine :func:`_orm.with_loader_criteria` with the :meth:`_orm.SessionEvents.do_orm_execute` event. :param track_closure_variables: when False, closure variables inside of a lambda expression will not be used as part of any cache key. This allows more complex expressions to be used inside of a lambda expression but requires that the lambda ensures it returns the identical SQL every time given a particular class. .. versionadded:: 1.4.0b2 t lambda_argstoptsttrack_closure_variablesN(RRRZR-R#Rt_where_crit_origtcallableRbtdeferred_where_criteriaRtDeferredLambdaElementRtWhereHavingRoleRt LambdaOptionsR$RRyR%R&(RBtentity_or_baseR$t loader_onlyR%R&R)R((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs,            cCst||d|d|S(NR%R&(R"(R>RR$R%R&((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt _unreduces cCs:tj|jr|jjn|j|j|j|jffS(N(R"R2RRR#R*R%R&(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt __reduce__s ccs|jr+x|jjjD] }|VqWn~t|jj}xf|r|jd}tj|dt }|rx/|jjD] }|VqWqC|j |jqCWdS(Nitraiseerr( RRtself_and_descendantstlistR#t__subclasses__RRRRZtextend(RBRtstacktsubclassR ((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt _all_mapperss    cCs&|jjjdd|kr"tStS(Ntfor_loader_criteria(tselect_statementRRR-RZRb(RBt compile_state((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_should_includes    cCsG|jr!|jj|j}n |j}tj|i|d6dtS(NR<tdetect_subquery_cols(R,R$t_resolve_with_argsRRt_deep_annotateRb(RBtext_infotcrit((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_resolve_where_criterias   cCs |j|S(N(tprocess_compile_state(RBR>tmapper_entities((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt'process_compile_state_replaced_entitiesscCs0|jjrtjdn|j|jdS(s7Apply a modification to a given :class:`.CompileState`.sThe with_loader_criteria() function may not work correctly with the legacy Query.with_polymorphic() feature. Please migrate code to use the with_polymorphic() standalone function before using with_loader_criteria().N(tcompile_optionst_with_polymorphic_adapt_mapRR=tget_global_criteriatglobal_attributes(RBR>((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRFs  cCs@x9|jD]+}|jd|fg}|j|q WdS(Ntadditional_entity_criteria(R;t setdefaultR^(RBRR t load_criteria((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRKs(RJRKRLRRt dp_plain_objtdp_has_cache_keyRRRt_traverse_internalsRZRbRRPR2R3R;R?RERHRFRK(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR"s$     cCs|jS(N(R(R((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytREcCs|S(N((R((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRSREc Cst|tjrb|r*tjdn|rF|jd|d|Stjtj |d|Sn"t |d|d|d|d|SdS(sProduce an alias of the given element, usually an :class:`.AliasedClass` instance. E.g.:: my_alias = aliased(MyClass) session.query(MyClass, my_alias).filter(MyClass.id > my_alias.id) The :func:`.aliased` function is used to create an ad-hoc mapping of a mapped class to a new selectable. By default, a selectable is generated from the normally mapped selectable (typically a :class:`_schema.Table` ) using the :meth:`_expression.FromClause.alias` method. However, :func:`.aliased` can also be used to link the class to a new :func:`_expression.select` statement. Also, the :func:`.with_polymorphic` function is a variant of :func:`.aliased` that is intended to specify a so-called "polymorphic selectable", that corresponds to the union of several joined-inheritance subclasses at once. For convenience, the :func:`.aliased` function also accepts plain :class:`_expression.FromClause` constructs, such as a :class:`_schema.Table` or :func:`_expression.select` construct. In those cases, the :meth:`_expression.FromClause.alias` method is called on the object and the new :class:`_expression.Alias` object returned. The returned :class:`_expression.Alias` is not ORM-mapped in this case. .. seealso:: :ref:`tutorial_orm_entity_aliases` - in the :ref:`unified_tutorial` :ref:`orm_queryguide_orm_aliases` - in the :ref:`queryguide_toplevel` :param element: element to be aliased. Is normally a mapped class, but for convenience can also be a :class:`_expression.FromClause` element. :param alias: Optional selectable unit to map the element to. This is usually used to link the object to a subquery, and should be an aliased select construct as one would produce from the :meth:`_query.Query.subquery` method or the :meth:`_expression.Select.subquery` or :meth:`_expression.Select.alias` methods of the :func:`_expression.select` construct. :param name: optional string name to use for the alias, if not specified by the ``alias`` parameter. The name, among other things, forms the attribute name that will be accessible via tuples returned by a :class:`_query.Query` object. Not supported when creating aliases of :class:`_sql.Join` objects. :param flat: Boolean, will be passed through to the :meth:`_expression.FromClause.alias` call so that aliases of :class:`_expression.Join` objects will alias the individual tables inside the join, rather than creating a subquery. This is generally supported by all modern databases with regards to right-nested joins and generally produces more efficient queries. :param adapt_on_names: if True, more liberal "matching" will be used when mapping the mapped columns of the ORM entity to those of the given selectable - a name-based match will be performed if the given selectable doesn't otherwise have a column that corresponds to one on the entity. The use case for this is when associating an entity with some derived selectable such as one that uses aggregate functions:: class UnitPrice(Base): __tablename__ = 'unit_price' ... unit_id = Column(Integer) price = Column(Numeric) aggregated_unit_price = Session.query( func.sum(UnitPrice.price).label('price') ).group_by(UnitPrice.unit_id).subquery() aggregated_unit_price = aliased(UnitPrice, alias=aggregated_unit_price, adapt_on_names=True) Above, functions on ``aggregated_unit_price`` which refer to ``.price`` will return the ``func.sum(UnitPrice.price).label('price')`` column, as it is matched on the name "price". Ordinarily, the "price" function wouldn't have any "column correspondence" to the actual ``UnitPrice.price`` column as it is not a proxy of the original. s+adapt_on_names only applies to ORM elementsRrRRRN( R+Rt FromClauseR2R3RRRyRtAnonymizedFromClauseRoleR(telementRRrRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytaliaseds\ c  Cst|} |d tfkr6|r6tjdn| r| j| ksQttj|}t g| j D]} | j ^qm} || kr| S|j | }n| j ||d|\} }|s|r|jd|}nt||d|d| d|d|d| S( sb Produce an :class:`.AliasedClass` construct which specifies columns for descendant mappers of the given base. Using this method will ensure that each descendant mapper's tables are included in the FROM clause, and will allow filter() criterion to be used against those tables. The resulting instances will also have those columns already loaded so that no "post fetch" of those columns will be required. .. seealso:: :ref:`with_polymorphic` - full discussion of :func:`_orm.with_polymorphic`. :param base: Base class to be aliased. :param classes: a single class or mapper, or list of class/mappers, which inherit from the base class. Alternatively, it may also be the string ``'*'``, in which case all descending mapped classes will be added to the FROM clause. :param aliased: when True, the selectable will be aliased. For a JOIN, this means the JOIN will be SELECTed from inside of a subquery unless the :paramref:`_orm.with_polymorphic.flat` flag is set to True, which is recommended for simpler use cases. :param flat: Boolean, will be passed through to the :meth:`_expression.FromClause.alias` call so that aliases of :class:`_expression.Join` objects will alias the individual tables inside the join, rather than creating a subquery. This is generally supported by all modern databases with regards to right-nested joins and generally produces more efficient queries. Setting this flag is recommended as long as the resulting SQL is functional. :param selectable: a table or subquery that will be used in place of the generated FROM clause. This argument is required if any of the desired classes use concrete table inheritance, since SQLAlchemy currently cannot generate UNIONs among tables automatically. If used, the ``selectable`` argument must represent the full set of tables and columns mapped by every mapped class. Otherwise, the unaccounted mapped columns will result in their table being appended directly to the FROM clause which will usually lead to incorrect results. When left at its default value of ``False``, the polymorphic selectable assigned to the base mapper is used for selecting rows. However, it may also be passed as ``None``, which will bypass the configured polymorphic selectable and instead construct an ad-hoc selectable for the target classes given; for joined table inheritance this will be a join that includes all target mappers and their subclasses. :param polymorphic_on: a column to be used as the "discriminator" column for the given selectable. If not given, the polymorphic_on attribute of the base classes' mapper will be used, if any. This is useful for mappings that don't have polymorphic loading behavior by default. :param innerjoin: if True, an INNER JOIN will be used. This should only be specified if querying for one specific subtype only :param adapt_on_names: Passes through the :paramref:`_orm.aliased.adapt_on_names` parameter to the aliased object. This may be useful in situations where the given selectable is not directly related to the existing mapped selectable. .. versionadded:: 1.4.33 s[the 'flat' and 'selectable' arguments cannot be passed simultaneously to with_polymorphic()t innerjoinRRRRRRN(RR-RZR2R3RRRtto_setR/RRtuniont_with_polymorphic_argsRR(RtclassesRRRRWRRXRt_existing_aliastprimary_mapperR t new_classestmappers((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytwith_polymorphic]s0R  "  tBundlecBseZdZeZeZeZeZeZ e j Z dZ dZedZedZedZd Zd ZdZdZedZd Zd ZRS( sHA grouping of SQL expressions that are returned by a :class:`.Query` under one namespace. The :class:`.Bundle` essentially allows nesting of the tuple-based results returned by a column-oriented :class:`_query.Query` object. It also is extensible via simple subclassing, where the primary capability to override is that of how the set of expressions should be returned, allowing post-processing as well as custom return types, without involving ORM identity-mapped classes. .. versionadded:: 0.9.0 .. seealso:: :ref:`bundles` cOs||_|_g|D]!}tjtj|d|^q|_}tdg|D]}|jj d|^qUD|_ |_ |j d|j |_ dS(sQConstruct a new :class:`.Bundle`. e.g.:: bn = Bundle("mybundle", MyClass.x, MyClass.y) for row in session.query(bn).filter( bn.c.x == 5).filter(bn.c.y == 4): print(row.mybundle.x, row.mybundle.y) :param name: name of the bundle. :param \*exprs: columns or SQL expressions comprising the bundle. :param single_entity=False: if True, rows for this :class:`.Bundle` can be returned as a "single entity" outside of any enclosing tuple in the same manner as a mapped entity. tapply_propagate_attrscss*|] }t|d|j|fVqdS(RUN(Rt_label(RRw((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pys stbundlet single_entityN(RrRdRRyRtColumnsClauseRoletexprsR!RRRItcolumnsRRf(RBRrRhR texprte((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs29cCsB|j|j|jftg|jD]}|j||^q"S(N(t __class__RrRfttupleRht_gen_cache_key(RBtanon_mapt bindparamsRj((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRnscCs|jdjjddS(NiR(RhRRR-(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRscCs|jdjjddS(NiR(RhRRR-(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR#scCs|jS(N(RI(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR'scCs,|jj|j}|jj|j|S(N(RlR<RR7(RBtcloned((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_cloneGsc Csi|d6|d6}|j|j|jdjjd|j}tjdtj dt g|jD]}|jjd|^qbj |j idd6|d6S( NReRiRt_literal_as_text_roletgroupRR( R7RRht_propagate_attrsRRRt ClauseListRRgRZRR(RBt annotationsRRk((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRLs  . cCs |jjS(N(Rtclauses(RB((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRxescCs|j}||_|S(s<Provide a copy of this :class:`.Bundle` passing a new label.(RrRr(RBRrRq((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRpis  cs8t|g|D] }d^q fd}|S(sProduce the "row processing" function for this :class:`.Bundle`. May be overridden by subclasses. .. seealso:: :ref:`bundles` - includes an example of subclassing. cs#gD]}||^q S(N((Rtproc(t keyed_tupletprocs(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRy|s((R(RBtqueryR{tlabelstlRy((RzR{sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytcreate_row_processorps "N(RJRKRLRZRftis_clause_elementt is_mapperRRbt is_bundleRt immutabledictRuRRnRRRRR-RiRIRrRRxRpR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRbs&     cCstj|itd6|S(sDeep copy the given ClauseElement, annotating each element with the "_orm_adapt" flag. Elements within the exclude collection will be cloned but not annotated. t _orm_adapt(RRBRb(RVtexclude((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt _orm_annotatescCstj|ddS(sRemove annotations that link a column to a particular mapping. Note this doesn't affect "remote" and "foreign" annotations passed by the :func:`_orm.foreign` and :func:`_orm.remote` annotators. R@RR(RR(Rt_deep_deannotate(RV((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_orm_deannotates cCs tj|S(N(RR(RV((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_orm_full_deannotatest_ORMJoincBskeZdZejjZeZde e ddddZ dZ de e ddZ de ddZ RS(s/Extend Join to support ORM constructs as input.c  Cstj|} tj|} | j} ||_||_t|d| } | |_t|tj r{t| j |}nt|t j r|j j} |j}||j7}n*t|tr|}|jj} nd}| j}|rtj| |r | }n|}|jd|d| dtd| dtd|\}}}}}}|dk r|rtj|||}|}qtj||||}|}n|}||_n| jr|jjdd}n!| js| jr| }nd}|dk r!|jj i|d6|_nt!|o1| }t"j#j$|||||||rt|j%tj&|M_%n| rt| d dr| j'j(r| j'j)}|dk r| jr| j*j+|}n|j%|@|_%qndS( Nt_joined_from_infotsource_selectabletdest_selectabletsource_polymorphictof_type_entitytalias_secondarytextra_criteriaRR(,RRRt _left_memot _right_memoRRR+RR,RRtQueryableAttributet comparatort_source_selectableRt_extra_criteriaRtparentR-Rtclause_is_presentt _create_joinsRbRR4t_target_adaptert is_selectableRRRRRZtboolRtJoinRRtand_Rtsinglet_single_table_criterionRR(RBtlefttrightRtisoutertfullRRRt left_infot right_infotadapt_tot left_orm_infot on_selectabletproptleft_selectablet adapt_fromtpjtsjtsourcetdestt secondaryttarget_adapterRtaugment_onclauset single_crit((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRst                      c Cs|}xt|tjr'|j}q W|j|ks=tt|j|j|jd|jd|j d|j }t||j|jd|jd|j S(slSplice a join into the center. Given join(a, b) and join(b, c), return join(a, b).join(c) RRR( R+RRRRRRRRRR(RBtothertleftmostR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_splice_into_centers"       cCst|||d|d|S(NRR(R(RBRRRRt join_to_left((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR43scCst|||dtd|S(NRR(RRb(RBRRRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt outerjoin=sN((RJRKRLRRt__visit_name__Rbt inherit_cacheR-RZRRR4R(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs  h  cCst|||||S(sProduce an inner join between left and right clauses. :func:`_orm.join` is an extension to the core join interface provided by :func:`_expression.join()`, where the left and right selectables may be not only core selectable objects such as :class:`_schema.Table`, but also mapped classes or :class:`.AliasedClass` instances. The "on" clause can be a SQL expression or an ORM mapped attribute referencing a configured :func:`_orm.relationship`. .. deprecated:: 1.4 using a string relationship name for the "onclause" is deprecated and will be removed in 2.0; the onclause may be only an ORM-mapped relationship attribute or a SQL expression construct. :func:`_orm.join` is not commonly needed in modern usage, as its functionality is encapsulated within that of the :meth:`_sql.Select.join` and :meth:`_query.Query.join` methods. which feature a significant amount of automation beyond :func:`_orm.join` by itself. Explicit use of :func:`_orm.join` with ORM-enabled SELECT statements involves use of the :meth:`_sql.Select.select_from` method, as in:: from sqlalchemy.orm import join stmt = select(User).\ select_from(join(User, Address, User.addresses)).\ filter(Address.email_address=='foo@bar.com') In modern SQLAlchemy the above join can be written more succinctly as:: stmt = select(User).\ join(User.addresses).\ filter(Address.email_address=='foo@bar.com') .. warning:: using :func:`_orm.join` directly may not work properly with modern ORM options such as :func:`_orm.with_loader_criteria`. It is strongly recommended to use the idiomatic join patterns provided by methods such as :meth:`.Select.join` and :meth:`.Select.join_from` when creating ORM joins. .. seealso:: :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` for background on idiomatic ORM join patterns (R(RRRRRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyR4As2cCst|||t|S(sProduce a left outer join between left and right clauses. This is the "outer join" version of the :func:`_orm.join` function, featuring the same behavior except that an OUTER JOIN is generated. See that function's documentation for other usage details. (RRb(RRRRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRvscCst|tjrCtjdt|}t|j|j}n3t|tj rv|j rj|j }n|j}n|j |d|S(sCreate filtering criterion that relates this query's primary entity to the given related instance, using established :func:`_orm.relationship()` configuration. E.g.:: stmt = select(Address).where(with_parent(some_user, User.addresses)) The SQL rendered is the same as that rendered when a lazy loader would fire off from the given parent on that attribute, meaning that the appropriate state is taken from the parent object in Python without the need to render joins to the parent table in the rendered statement. The given property may also make use of :meth:`_orm.PropComparator.of_type` to indicate the left side of the criteria:: a1 = aliased(Address) a2 = aliased(Address) stmt = select(a1, a2).where( with_parent(u1, User.addresses.of_type(a2)) ) The above use is equivalent to using the :func:`_orm.with_parent.from_entity` argument:: a1 = aliased(Address) a2 = aliased(Address) stmt = select(a1, a2).where( with_parent(u1, User.addresses, from_entity=a2) ) :param instance: An instance which has some :func:`_orm.relationship`. :param property: String property name, or class-bound attribute, which indicates what relationship from the instance should be used to reconcile the parent/child relationship. .. deprecated:: 1.4 Using strings is deprecated and will be removed in SQLAlchemy 2.0. Please use the class-bound attribute directly. :param from_entity: Entity in which to consider as the left side. This defaults to the "zero" entity of the :class:`_query.Query` itself. .. versionadded:: 1.2 sUsing strings to indicate relationship names in the ORM with_parent() function is deprecated and will be removed SQLAlchemy 2.0. Please use the class-bound attribute directly.t from_entity( R+RR,twarn_deprecated_20RRRRRRt_of_typet _with_parent(RRRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt with_parents6    cCstj|}|jS(sReturn True if the given object has a database identity. This typically corresponds to the object being in either the persistent or detached state. .. seealso:: :func:`.was_deleted` (Rtinstance_statet has_identity(tobject_RS((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs cCstj|}|jS(sReturn True if the given object was deleted within a session flush. This is regardless of whether or not the object is persistent or detached. .. seealso:: :attr:`.InstanceState.was_deleted` (RRt was_deleted(RRS((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyRs cCsn|jr5|jr1|j|jkr1tSntS|jra|jrT||jkS||kSn|j|S(sdetermine if 'given' corresponds to 'entity', in terms of an entity passed to Query that would match the same entity being referred to elsewhere in the query. (RRRbRZRRt common_parent(tgivenR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_entity_corresponds_tos      cCsh|jr5|jo4|j o4||kp4||jkS|jsN|j|jS|joc||jkSdS(sdetermine if 'given' corresponds to 'entity', in terms of a path of loader options where a mapped attribute is taken to be a member of a parent entity. e.g.:: someoption(A).someoption(A.b) # -> fn(A, A) -> True someoption(A).someoption(C.d) # -> fn(A, C) -> False a1 = aliased(A) someoption(a1).someoption(A.b) # -> fn(a1, A) -> False someoption(a1).someoption(a1.b) # -> fn(a1, a1) -> True wp = with_polymorphic(A, [A1, A2]) someoption(wp).someoption(A1.foo) # -> fn(wp, A1) -> False someoption(wp).someoption(wp.A1.foo) # -> fn(wp, wp.A1) -> True N(RRRRRR(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt$_entity_corresponds_to_use_path_impls     cCsO|jr(||jkp'|jj|S|jr>||jkS|j|SdS(sedetermine if 'given' "is a" mapper, in terms of the given would load rows of type 'mapper'. N(RRRR(RR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt _entity_isas    cCskddlm}m}m}m}ddlm}ddlm}||_ |_ |_ |_ |_ dS(sZUse random-ordering sets within the unit of work in order to detect unit of work sorting issues. This is a utility function that can be used to help reproduce inconsistent unit of work sorting issues. For example, if two kinds of objects A and B are being inserted, and B has a foreign key reference to A - the A must be inserted first. However, if there is no relationship between A and B, the unit of work won't know to perform this sorting, and an operation may or may not fail, depending on how the ordering works out. Since Python sets and dictionaries have non-deterministic ordering, such an issue may occur on some runs and not on others, and in practice it tends to have a great dependence on the state of the interpreter. This leads to so-called "heisenbugs" where changing entirely irrelevant aspects of the test program still cause the failure behavior to change. By calling ``randomize_unitofwork()`` when a script first runs, the ordering of a key series of sets within the unit of work implementation are randomized, so that the script can be minimized down to the fundamental mapping and operation that's failing, while still reproducing the issue on at least some runs. This utility is also available when running the test suite via the ``--reversetop`` flag. i(t unitofworktsessionRt dependency(t topological(t RandomSetN( tsqlalchemy.ormRRRRtsqlalchemy.utilRtsqlalchemy.testing.utilRR/(RRRRRR((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pytrandomize_unitofwork.s"cs6fd}t|trtj|\}}}t|trht|trh||dkrhgSt|tr|dkst|tr|dkr|t||S|j||}|dk rt|dd|jSt|Sn:|dkr|t|dSt|||d!dSdS(sdcalculate __getitem__ in terms of an iterable query object that also has a slice() method. cs&stdn tjddS(Ns@negative indexes are not accepted by SQL index / slice operatorssSupport for negative indexes for SQL index / slice operators will be removed in 2.0; these operators fetch the complete result and do not work efficiently.(t IndexErrorRR((tallow_negative(sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_no_negative_indexesXs  iiiN(R+tsliceRt decode_slicetintR6R-tstep(titerable_querytitemRRtstarttstopRtres((RsF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt_getitemRs&   (SRFRvRRERRRRRRRRRRR R R R t interfacesR RRRRRt path_registryRRRR2RRRt engine.resultRtsql_baseRRRRRRtsql.annotationR tsql.baseR!R;RMR'RjRbRRRRRRtMemoizedHasCacheKeyRRR"t _inspectsR-RZRWRat_self_inspectsRbRRRRRR4RRRRRRRRR(((sF/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/orm/util.pyt s    B CQ h((At j   4 F    #  $