Ë
    ðmxiÔ  ã                  óÂ  — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 d	d
l
mZ ddlmZ ddlm
Z
 ddlmZ ddlmZ erd	dlmZ d	dlmZ d	dlmZ  e	de¬«      ZeefZ	  G d„ dej4                  «      ZeZ G d„ dej4                  «      Z G d„ dej<                  «      Z G d„ dej@                  «      Z! G d„ dej4                  «      Z" G d„ d ej4                  «      Z# G d!„ d"e!«      Z$ G d#„ d$e!«      Z% G d%„ d&ej@                  «      Z& G d'„ d(ej@                  «      Z' G d)„ d*ej@                  «      Z(d/d+„Z) e
jT                  d,«      d0d-„«       Z+y.)1zSQLAlchemy ORM exceptions.é    )Úannotations)ÚAny)ÚOptional)ÚTuple)ÚType)ÚTYPE_CHECKING)ÚTypeVaré   )Ú_mapper_property_as_plain_nameé   )Úexc)Úutil)ÚMultipleResultsFound)ÚNoResultFound)ÚLoaderStrategy)ÚMapperProperty)ÚInstanceStateÚ_T)Úboundc                  ó   — e Zd ZdZy)ÚStaleDataErroraa  An operation encountered database state that is unaccounted for.

    Conditions which cause this to happen include:

    * A flush may have attempted to update or delete rows
      and an unexpected number of rows were matched during
      the UPDATE or DELETE statement.   Note that when
      version_id_col is used, rows in UPDATE or DELETE statements
      are also matched against the current known version
      identifier.

    * A mapped object with version_id_col was refreshed,
      and the version number coming back from the database does
      not match that of the object itself.

    * A object is detached from its parent object, however
      the object was previously attached to a different parent
      identity which was garbage collected, and a decision
      cannot be made if the new parent was really the most
      recent "parent".

    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úI/home/htdocs/ttos/venv/lib/python3.12/site-packages/sqlalchemy/orm/exc.pyr   r   $   s   „ òr   r   c                  ó   — e Zd ZdZy)Ú
FlushErrorz0A invalid condition was detected during flush().Nr   r   r   r   r!   r!   @   s   „ Ú:r   r!   c                  ó   — e Zd ZdZy)ÚMappedAnnotationErrorzŸRaised when ORM annotated declarative cannot interpret the
    expression present inside of the :class:`.Mapped` construct.

    .. versionadded:: 2.0.40

    Nr   r   r   r   r#   r#   D   s   „ òr   r#   c                  ó   — e Zd ZdZy)ÚUnmappedErrorz?Base for exceptions that involve expected mappings not present.Nr   r   r   r   r%   r%   M   s   „ ÚIr   r%   c                  ó   — e Zd ZdZy)ÚObjectDereferencedErrorzPAn operation cannot complete due to an object being garbage
    collected.

    Nr   r   r   r   r'   r'   Q   s   „ òr   r'   c                  ó   — e Zd ZdZdZy)ÚDetachedInstanceErrorzSAn attempt to access unloaded attributes on a
    mapped instance that is detached.Úbhk3N)r   r   r   r   Úcoder   r   r   r)   r)   X   s   „ ñ)ð �Dr   r)   c                  óL   — e Zd ZdZ ej
                  d«      ddd„«       Zdd„Zy)	ÚUnmappedInstanceErrorz;An mapping operation was requested for an unknown instance.úsqlalchemy.orm.baseNc                óh  — t         j                  j                  }|s8	 |j                  t	        |«      «       t        t	        |«      «      }d|›d|›d�}t        j                  | |«       y # t        $ r< dt        t	        |«      «      › d�}t        |t        «      r|dt        |«      z  z  }Y Œ[w xY w)NzClass z| is mapped, but this instance lacks instrumentation.  This occurs when the instance is created before sqlalchemy.orm.mapper(z) was called.úClass 'ú' is not mappedz;; was a class (%s) supplied where an instance was required?)
r   Ú	preloadedÚorm_baseÚclass_mapperÚtypeÚ_safe_cls_nameÚUnmappedClassErrorÚ
isinstancer%   Ú__init__)ÚselfÚobjÚmsgÚbaseÚnames        r   r9   zUnmappedInstanceError.__init__b   s¬   € ä�~‰~×&Ñ&ˆáðØ×!Ñ!¤$ s£)Ô,Ü%¤d¨3£iÓ0‘ò
 &*ª4ð1ð ô 	×Ñ˜t SÕ)øô &ò Ø¤¬t°C«yÓ 9Ð:¸/ÐJ�Ü˜c¤4Ô(Øð$Ü&4°SÓ&9ñ:ñ�Cùðús   ž7A, Á,AB1Â0B1c                ó<   — | j                   d | j                  d   ffS ©Nr   ©Ú	__class__Úargs©r:   s    r   Ú
__reduce__z UnmappedInstanceError.__reduce__y   ó   € Ø�~‰~  d§i¡i°¡lÐ3Ð3Ð3r   ©N)r;   Úobjectr<   úOptional[str]©Úreturnr   ©r   r   r   r   r   Úpreload_moduler9   rE   r   r   r   r-   r-   _   s*   „ ÙEà€T×ÑÐ.Ó/ó*ó 0ð*ô,4r   r-   c                  ó"   — e Zd ZdZddd„Zdd„Zy)r7   z8An mapping operation was requested for an unknown class.Nc                óJ   — |st        |«      }t        j                  | |«       y rG   )Ú_default_unmappedr%   r9   )r:   Úclsr<   s      r   r9   zUnmappedClassError.__init__€   s   € ÙÜ# CÓ(ˆCÜ×Ñ˜t SÕ)r   c                ó<   — | j                   d | j                  d   ffS r@   rA   rD   s    r   rE   zUnmappedClassError.__reduce__…   rF   r   rG   )rQ   zType[_T]r<   rI   rJ   )r   r   r   r   r9   rE   r   r   r   r7   r7   }   s   „ ÙBô*ô
4r   r7   c                  óL   — e Zd ZdZ ej
                  d«      ddd„«       Zdd„Zy)	ÚObjectDeletedErroraï  A refresh operation failed to retrieve the database
    row corresponding to an object's known primary key identity.

    A refresh operation proceeds when an expired attribute is
    accessed on an object, or when :meth:`_query.Query.get` is
    used to retrieve an object which is, upon retrieval, detected
    as expired.   A SELECT is emitted for the target row
    based on primary key; if no row is returned, this
    exception is raised.

    The true meaning of this exception is simply that
    no row exists for the primary key identifier associated
    with a persistent object.   The row may have been
    deleted, or in some cases the primary key updated
    to a new value, outside of the ORM's management of the target
    object.

    r.   Nc                ó¤   — t         j                  j                  }|sd|j                  |«      z  }t        j
                  j                  | |«       y )NzDInstance '%s' has been deleted, or its row is otherwise not present.)r   r2   r3   Ú	state_strÚsa_excÚInvalidRequestErrorr9   )r:   Ústater<   r=   s       r   r9   zObjectDeletedError.__init__�   sH   € ä�~‰~×&Ñ&ˆáð0Ø26·.±.ÀÓ2GñHð ô
 	×"Ñ"×+Ñ+¨D°#Õ6r   c                ó<   — | j                   d | j                  d   ffS r@   rA   rD   s    r   rE   zObjectDeletedError.__reduce__©   rF   r   rG   )rY   zInstanceState[Any]r<   rI   rJ   rL   r   r   r   rT   rT   ‰   s.   „ ñð& €T×ÑÐ.Ó/ó	7ó 0ð	7ô4r   rT   c                  ó   — e Zd ZdZy)ÚUnmappedColumnErrorz5Mapping operation was requested on an unknown column.Nr   r   r   r   r\   r\   ­   s   „ Ú?r   r\   c                  ó,   — e Zd ZdZ	 	 	 	 	 	 	 	 	 	 dd„Zy)ÚLoaderStrategyExceptionz2A loader strategy for an attribute does not exist.c                ó  — |€'t         j                  j                  | d|›d|›�«       y |€J ‚t         j                  j                  | dt        j                  |«      ›d|›dt        |«      ›dt        |«      ›d�	«       y )NzCan't find strategy z for zCan't apply "z" strategy to property "z", which is a "z7"; this loader strategy is intended to be used with a "z".)rW   rX   r9   r   Úclsname_as_plain_namer   )r:   Úapplied_to_property_typeÚrequesting_propertyÚ
applies_toÚactual_strategy_typeÚstrategy_keys         r   r9   z LoaderStrategyException.__init__´   s{   € ð  Ð'Ü×&Ñ&×/Ñ/ÙâÑ!4ð6õð Ð)Ð)Ð)Ü×&Ñ&×/Ñ/Ùô
 ×.Ñ.Ð/CÕDÚ'Ü2Ð3KÕLÜ2°:Õ>ðõr   N)
ra   ú	Type[Any]rb   zMapperProperty[Any]rc   z#Optional[Type[MapperProperty[Any]]]rd   zOptional[Type[LoaderStrategy]]re   zTuple[Any, ...])r   r   r   r   r9   r   r   r   r^   r^   ±   s:   „ Ù<ðà"+ðð 1ðð 8ð	ð
 =ðð &ôr   r^   c                óª   — 	 dj                  | j                  | j                  f«      }|S # t        $ r t	        | dd «      }|€t        | «      }Y |S w xY w)Nú.r   )Újoinr   r   ÚAttributeErrorÚgetattrÚrepr)rQ   Úcls_names     r   r6   r6   Ò   s]   € ð!Ø—8‘8˜SŸ^™^¨S¯\©\Ð:Ó;ˆð
 €Oøô	 ò !Ü˜3 
¨DÓ1ˆØÐÜ˜C“yˆHøØ€Oð	!ús   ‚'+ «#AÁAr.   c                óÒ   — t         j                  j                  }	 |j                  | «      j                  }t        | «      }|sd|› d�S y # t
        t        ft        z   $ r i }Y Œ.w xY w)Nr0   r1   )	r   r2   r3   Úmanager_of_classÚmappersr7   Ú	TypeErrorÚNO_STATEr6   )rQ   r=   rp   r>   s       r   rP   rP   Ý   sw   € ä�>‰>×"Ñ"€DðØ×'Ñ'¨Ó,×4Ñ4ˆô ˜#Ó€DáØ˜˜˜oÐ.Ð.àøô 	Üðô 	ñò ð Šð	ús   œA ÁA&Á%A&N)rQ   rf   rK   Ústr)rQ   rf   rK   rI   ),r   Ú
__future__r   Útypingr   r   r   r   r   r	   r   r   Ú r   rW   r   r   Ú
interfacesr   r   rY   r   r   rj   ÚKeyErrorrr   ÚSQLAlchemyErrorr   ÚConcurrentModificationErrorr!   ÚArgumentErrorr#   rX   r%   r'   r)   r-   r7   rT   r\   r^   r6   rM   rP   r   r   r   ú<module>r|      sB  ðñ !å "å Ý Ý Ý Ý  Ý å 0Ý Ý Ý &Ý áÝ*Ý*Ý$áˆT˜Ô€à˜HÐ%€Ø Lô�V×+Ñ+ô ð2 -Ð ô;�×'Ñ'ô ;ô˜F×0Ñ0ô ôJ�F×.Ñ.ô Jô˜f×4Ñ4ô ô˜F×2Ñ2ô ô4˜Mô 4ô<	4˜ô 	4ô!4˜×3Ñ3ô !4ôH@˜&×4Ñ4ô @ô˜f×8Ñ8ô óBð €×ÑÐ*Ó+òó ,ñr   