Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
dynamic.cpython-313.pyc90 linesDownload Raw Back to __pycache__
1�

2��j(��z�SrSSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJ	r	 SS	KJ3r4 SS5KJr SSKJr SSKJ
r
 SS
KJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJr SSKJ r  SSKJr SSK!J"r" \(a0SSKJ#r# SSK$J%r% SSKJ&r& SSKJ'r' SS K(J)r) SS!KJ*r* SS"K+J,r, SS#K-J.r. \
"S$\S%9r/"S&S'\\/5r0"S(S)\5r1\RdRgS*S+9"S,S-\ 55r4"S.S/\\/5r5"S0S1\5\/\\/5r6S4S2jr7g3)5z�Dynamic collection API.6 7Dynamic collections act like Query() objects for read operations and support8basic add/delete mutation.9 10.. legacy:: the "dynamic" loader is a legacy feature, superseded by the11 "write_only" loader.12 13 14�)�annotations)�Any)�Iterable)�Iterator)�List)�Optional)�overload)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar)�Union�)�15attributes)�exc)�
relationships)�util)�PassiveFlag)�Query)�object_session)�AbstractCollectionWriter)�WriteOnlyAttributeImpl)�WriteOnlyHistory)�WriteOnlyLoader�)�result)�QueryableAttribute)�Mapper)�_RelationshipOrderByArg)�Session)�
InstanceState)�AliasedClass)�	_Dispatch)�
ColumnElement�_T)�boundc�6�\rSrSrSSSjjrSrg)�DynamicCollectionHistory�>Nc�z�U(a_[X5RS5n[R"U5UlUR16UlURUlSUlg[R"5Ul[R"5Ul[R"5UlSUlg)NFT)�
AppenderQuery�	autoflushr�OrderedIdentitySet�unchanged_items�added_items�
deleted_items�_reconcile_collection)�self�attr�state�passive�apply_to�colls      �\D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/orm/dynamic.py�__init__�!DynamicCollectionHistory.__init__?s���� ��-�7�7��>�D�#'�#:�#:�4�#@�D� �'�3�3�D��!)�!7�!7�D��)-�D�&�!%�!8�!8�!:�D��#�6�6�8�D��#'�#:�#:�#<�D� �).�D�&�)r1r/r0r.�N)17r3�DynamicAttributeImplr4�InstanceState[_T]r5rr6z&Optional[DynamicCollectionHistory[_T]]�return�None)�__name__�18__module__�__qualname__�__firstlineno__r9�__static_attributes__�r;r8r(r(>sB��<@�/�"�/�!�/��	/�199�/�20�
/�/r;r(c�\�\rSrSr%Sr\\rS\S'SS	Sjjr	Sr21g)22r=�STzType[AppenderMixin[Any]]�query_classNc�23�[RR"XUSU40UD6 X@lU(a[	U5UlU(d[Ulg[UR5;aX`lg[U5Ulgr<)r�
AttributeImplr9�
target_mapper�tuple�order_byr+rI�
AppenderMixin�mro�mixin_user_query)r2�class_�key�dispatchrLrNrI�kws        r8r9�DynamicAttributeImpl.__init__Xsl��	� � �)�)��#�t�X�	24�13�	25�+���!�(�O�D�M��,�D��
�k�o�o�/�
/�*��/��<�D�r;)rNrIrLr<)rRz#Union[Type[Any], AliasedClass[Any]]rS�strrTz"_Dispatch[QueryableAttribute[Any]]rLz26Mapper[_T]rNrrIz!Optional[Type[AppenderMixin[_T]]]rUrr?r@)rArBrCrD�_supports_dynamic_iterationr(r�collection_history_cls�__annotations__r9rErFr;r8r=r=Ssv��"&��5�c�:��)�)�:>�=�3�=��=�5�	=�27"�=�*�
=�7�=��=�28�=�=r;r=�dynamic)�lazyc��\rSrSr\rSrg)�29DynaLoader�prFN)rArBrCrDr=�30impl_classrErFr;r8r^r^ps��%�Jr;r^c�8^�\rSrSr%SrSrS\S'S\S'SU4Sjjr\SS	j5r	\	RSS31j5r	SSjr\(aSSjr
\SS
j5r\SSj5rSSjrS SjrS!S"SjjrS#SjrS$SjrS#SjrS$SjrS$SjrSrU=r$)%rO�uzLA mixin that expects to be mixing in a Query class with32AbstractAppender.33 34 35NzOptional[Type[Query[_T]]]rIzTuple[ColumnElement[Any], ...]�_order_by_clausesc�h>�[R"UURS5 [TU]X5 gr<)rr9rL�super)r2r3r4�	__class__s   �r8r9�AppenderMixin.__init__s/���	��������	36�37	����%r;c���[UR5nUb1UR(a URU;aUR5 [R38"UR5(dgU$r<)r�instancer,�flush�orm_util�has_identity�r2�sesss  r8�session�AppenderMixin.session�sM���d�m�m�,�������4�=�=�D�3H��J�J�L��$�$�T�]�]�3�3���Kr;c��Xlgr<�rn)r2ros  r8rorp�s���	r;c39�|�URnUGc[R"UR5nUR(a-[40R"S[R"U5-5 [R"[R"URRR/5[URR![R"UR5["R$5R&5SS9R)5$UR+U5R-5$)Nz�Instance %s is detached, dynamic relationship cannot return a correct result.   This warning will become a DetachedInstanceError in a future release.T)�_source_supports_scalars)ror�instance_stateri�detachedr�warnrk�	state_strr�IteratorResult�SimpleResultMetaDatar3rRrA�iter�_get_collection_historyr�PASSIVE_NO_INITIALIZEr/�scalars�	_generate�_iter)r2rnr4s   r8r��AppenderMixin._iter�s����|�|���<��-�-�d�m�m�<�E��~�~��	�	�C� �)�)�%�0�2���(�(��+�+�T�Y�Y�-=�-=�-F�-F�,G�H���I�I�5�5�"�1�1�$�-�-�@�#�9�9��"�k�	�*.�	��g�i�	
��>�>�$�'�-�-�/�/r;c��gr<rF)r2s r8�__iter__�AppenderMixin.__iter__�s��Cr;c��gr<rF�r2�indexs  r8�__getitem__�AppenderMixin.__getitem__�s��-0r;c��gr<rFr�s  r8r�r��s��58r;c��URnUcWURR[R"UR415[R5RU5$URU5RU5$r<)ror3r|rrurirr}�indexedrr�)r2r�rns   r8r�r��si���|�|���<��9�9�4�4��)�)�$�-�-�8��1�1���g�e�n�
�42�>�>�$�'�3�3�E�:�:r;c��URnUc[[URR[R43"UR5[R5R5$URU5R5$r<)ro�lenr3r|rrurirr}r/r�countrms  r8r��AppenderMixin.count�sk���|�|���<���	�	�1�1��-�-�d�m�m�<��5�5���+�	�
��>�>�$�'�-�-�/�/r;c���URnUcU[U5nUcG[R"S[R44"U5<SURR<S35eUR(a%URURRUS9nO%URURR5nURUlURUlURUl
U$)NzParent instance zh is not bound to a Session, and no contextual session is established; lazy load operation of attribute 'z' cannot proceed)ro)rir�orm_exc�DetachedInstanceErrorrk�instance_strr3rSrIrL�query�_where_criteria�	_from_objrc)r2rnrir�s    r8r�AppenderMixin._generate�s����=�=���<�!�(�+�D��|��3�3� �,�,�X�6��	�	�
�
�G�������$�$�T�Y�Y�%<�%<�d�$�K�E��J�J�t�y�y�6�6�7�E� $� 4� 4����.�.���"&�"8�"8����r;c�&�URU5 g)aNAdd an iterable of items to this :class:`_orm.AppenderQuery`.45 46The given items will be persisted to the database in terms of47the parent instance's collection on the next flush.48 49This method is provided to assist in delivering forwards-compatibility50with the :class:`_orm.WriteOnlyCollection` collection class.51 52.. versionadded:: 2.053 54N��
_add_all_impl�r2�iterators  r8�add_all�AppenderMixin.add_all�s��	
���8�$r;c�(�URU/5 g)a@Add an item to this :class:`_orm.AppenderQuery`.55 56The given item will be persisted to the database in terms of57the parent instance's collection on the next flush.58 59This method is provided to assist in delivering forwards-compatibility60with the :class:`_orm.WriteOnlyCollection` collection class.61 62.. versionadded:: 2.063 64Nr��r2�items  r8�add�AppenderMixin.add�s��	
���D�6�"r;c�&�URU5 g)z�Add an iterable of items to this :class:`_orm.AppenderQuery`.65 66The given items will be persisted to the database in terms of67the parent instance's collection on the next flush.68 69Nr�r�s  r8�extend�AppenderMixin.extend	s��	
���8�$r;c�(�URU/5 g)z�Append an item to this :class:`_orm.AppenderQuery`.70 71The given item will be persisted to the database in terms of72the parent instance's collection on the next flush.73 74Nr�r�s  r8�append�AppenderMixin.appends��	
���D�6�"r;c�&�URU5 g)z�Remove an item from this :class:`_orm.AppenderQuery`.75 76The given item will be removed from the parent instance's collection on77the next flush.78 79N)�_remove_implr�s  r8�remove�AppenderMixin.removes��	
���$�r;rr)r3r=r4r>r?r@)r?�Optional[Session])ror r?r@)r?z1Union[result.ScalarResult[_T], result.Result[_T]])r?zIterator[_T])r��intr?r%)r��slicer?zList[_T])r�zUnion[int, slice]r?zUnion[_T, List[_T]])r?r�r<)rnr�r?z	Query[_T])r�zIterable[_T]r?r@)r�r%r?r@)rArBrCrD�__doc__rIrZr9�propertyro�setterr�rr�r	r�r�rr�r�r�r�r�rE�
__classcell__)rfs@r8rOrOus�����.2�K�*�1�5�5�&�(�&�1B�&�	
�&�����
�^�^����0�2�/�
�0��0�
�8��8�;�800�#'����81��:%�#�%�#� � r;rOc��\rSrSrSrSrg)r+i%z�A dynamic query that supports basic collection storage operations.82 83Methods on :class:`.AppenderQuery` include all methods of84:class:`_orm.Query`, plus additional methods used for collection85persistence.86 87 88rFN)rArBrCrDr�rErFr;r8r+r+%s��r;r+c�J�SUR-n[U[U4SU05$)zAReturn a new class with AppenderQuery functionality layered over.�AppenderrI)rA�typerO)�cls�names  r8rQrQ0s)������$�D���}�c�*�]�C�,@�A�Ar;N)r�rr?ztype[AppenderMixin[Any]])8r��89__future__r�typingrrrrrr	r90rrr
r�rrr�rrrk�baserr�rror�	writeonlyrrrr�enginerr�mapperrrr r4r!r"�eventr#�sql.elementsr$r%r(r=�RelationshipProperty�strategy_forr^rOr+rQrFr;r8�<module>r�s��	�#��������� ���������#�/�-�'�&����$��6� �$�"�!�,��T����/�/��3�/�*=�1�=�:�#�#�0�0�i�0�@�&��&�A�&�m �,�R�0�m �`�M�"�%�u�R�y��Br;
codekingpro/portable-devtools · Team Ai