ó
    Ñ]jÔ  ã                  óÊ  • S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  S	S
K
Jr  SSKJr  SSKJ
r
  SSKJr  SSKJr  \(       a  S	SKJr  S	SKJr  S	SKJr  \	" S\S9r\\4r  " S S\R4                  5      r\r " S S\R4                  5      r " S S\R<                  5      r " S S\R@                  5      r! " S S\R4                  5      r" " S S \R4                  5      r# " S! S"\!5      r$ " S# S$\!5      r% " S% S&\R@                  5      r& " S' S(\R@                  5      r' " S) S*\R@                  5      r(S/S+ jr)\
RT                  " S,5      S0S- j5       r+g.)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                  ó   • \ rS rSrSrSrg)ÚStaleDataErroré$   a!  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__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    ÚO/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sqlalchemy/orm/exc.pyr   r   $   s   † ôr!   r   c                  ó   • \ rS rSrSrSrg)Ú
FlushErroré@   z0A invalid condition was detected during flush().r   Nr   r   r!   r"   r$   r$   @   s   † Ü:r!   r$   c                  ó   • \ rS rSrSrSrg)ÚMappedAnnotationErroréD   z“Raised when ORM annotated declarative cannot interpret the
expression present inside of the :class:`.Mapped` construct.

.. versionadded:: 2.0.40

r   Nr   r   r!   r"   r'   r'   D   s   † ôr!   r'   c                  ó   • \ rS rSrSrSrg)ÚUnmappedErroréM   z?Base for exceptions that involve expected mappings not present.r   Nr   r   r!   r"   r*   r*   M   s   † ÜIr!   r*   c                  ó   • \ rS rSrSrSrg)ÚObjectDereferencedErroréQ   zHAn operation cannot complete due to an object being garbage
collected.

r   Nr   r   r!   r"   r-   r-   Q   s   † ôr!   r-   c                  ó   • \ rS rSrSrSrSrg)ÚDetachedInstanceErroréX   zOAn attempt to access unloaded attributes on a
mapped instance that is detached.Úbhk3r   N)r   r   r   r   r   Úcoder    r   r!   r"   r0   r0   X   s   † ñ)ð ƒDr!   r0   c                  óZ   • \ rS rSrSr\R                  " S5      SS	S jj5       rS
S jrSr	g)ÚUnmappedInstanceErroré_   z;An mapping operation was requested for an unknown instance.úsqlalchemy.orm.baseNc                ó€  • [         R                  R                  nU(       d:   UR                  [	        U5      5        [        [	        U5      5      nSU< SU< S3n[        R                  X5        g ! [         aA    S[        [	        U5      5       S3n[        U[        5      (       a  US[        U5      -  -  n N`f = f)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"   rB   ÚUnmappedInstanceError.__init__b   s­   € ä�~‰~×&Ñ&ˆæðØ×!Ñ!¤$ s£)Ô,Ü%¤d¨3£iÓ0‘ó
 &*«4ð1ð ô 	×Ñ˜tÕ)øô &ó Ø¤¬t°C«yÓ 9Ð:¸/ÐJ�Ü˜c¤4×(Ñ(Øð$Ü&4°SÓ&9ñ:ñ�Cùðús   £9A2 Á2AB=Â<B=c                ó<   • U R                   S U R                  S   44$ ©Nr   ©Ú	__class__Úargs©rC   s    r"   Ú
__reduce__Ú UnmappedInstanceError.__reduce__y   ó   € Ø�~‰~  d§i¡i°¡lÐ3Ð3Ð3r!   r   ©N)rD   ÚobjectrE   úOptional[str]©Úreturnr   ©
r   r   r   r   r   r   Úpreload_modulerB   rO   r    r   r!   r"   r5   r5   _   s(   † ÙEà	×ÒÐ.Ó/õ*ó 0ð*÷,4r!   r5   c                  ó0   • \ rS rSrSrSSS jjrS	S jrSrg)
r@   é}   z8An mapping operation was requested for an unknown class.Nc                óR   • U(       d  [        U5      n[        R                  X5        g rR   )Ú_default_unmappedr*   rB   )rC   ÚclsrE   s      r"   rB   ÚUnmappedClassError.__init__€   s   € ÞÜ# CÓ(ˆCÜ×Ñ˜tÕ)r!   c                ó<   • U R                   S U R                  S   44$ rJ   rK   rN   s    r"   rO   ÚUnmappedClassError.__reduce__…   rQ   r!   r   rR   )r]   zType[_T]rE   rT   rU   )r   r   r   r   r   rB   rO   r    r   r!   r"   r@   r@   }   s   † ÙBö*÷
4r!   r@   c                  óZ   • \ rS rSrSr\R                  " S5      SS	S jj5       rS
S jrSr	g)ÚObjectDeletedErroré‰   a·  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.

r7   Nc                ó¬   • [         R                  R                  nU(       d  SUR                  U5      -  n[        R
                  R                  X5        g )NzDInstance '%s' has been deleted, or its row is otherwise not present.)r   r;   r<   Ú	state_strÚsa_excÚInvalidRequestErrorrB   )rC   ÚstaterE   rF   s       r"   rB   ÚObjectDeletedError.__init__�   sF   € ä�~‰~×&Ñ&ˆæð0Ø26·.±.ÀÓ2GñHð ô
 	×"Ñ"×+Ñ+¨DÕ6r!   c                ó<   • U R                   S U R                  S   44$ rJ   rK   rN   s    r"   rO   ÚObjectDeletedError.__reduce__©   rQ   r!   r   rR   )rh   zInstanceState[Any]rE   rT   rU   rW   r   r!   r"   rb   rb   ‰   s,   † ñð& 
×ÒÐ.Ó/õ	7ó 0ð	7÷4r!   rb   c                  ó   • \ rS rSrSrSrg)ÚUnmappedColumnErroré­   z5Mapping operation was requested on an unknown column.r   Nr   r   r!   r"   rm   rm   ­   s   † Ü?r!   rm   c                  ó6   • \ rS rSrSr          SS jrSrg)ÚLoaderStrategyExceptioné±   z2A loader strategy for an attribute does not exist.c                ó  • Uc)  [         R                  R                  U SU< SU< 35        g Uc   e[         R                  R                  U S[        R                  " U5      < SU< S[        U5      < S[        U5      < S3	5        g )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".)rf   rg   rB   r   Úclsname_as_plain_namer   )rC   Úapplied_to_property_typeÚrequesting_propertyÚ
applies_toÚactual_strategy_typeÚstrategy_keys         r"   rB   Ú LoaderStrategyException.__init__´   s{   € ð  Ñ'Ü×&Ñ&×/Ñ/ÙãÒ!4ð6õð Ñ)Ð)Ð)Ü×&Ñ&×/Ñ/Ùô
 ×.Ò.Ð/CÖDÛ'Ü2Ð3KÖLÜ2°:Ö>ðõr!   r   N)
rt   ú	Type[Any]ru   zMapperProperty[Any]rv   z#Optional[Type[MapperProperty[Any]]]rw   zOptional[Type[LoaderStrategy]]rx   zTuple[Any, ...])r   r   r   r   r   rB   r    r   r!   r"   rp   rp   ±   s:   † Ù<ðà"+ðð 1ðð 8ð	ð
 =ðð &÷r!   rp   c                ó®   •  SR                  U R                  U R                  45      nU$ ! [         a    [	        U SS 5      nUc  [        U 5      n U$ f = f)NÚ.r   )Újoinr   r   ÚAttributeErrorÚgetattrÚrepr)r]   Úcls_names     r"   r?   r?   Ò   s]   € ð!Ø—8‘8˜SŸ^™^¨S¯\©\Ð:Ó;ˆð
 €Oøô	 ó !Ü˜3 
¨DÓ1ˆØÑÜ˜C“yˆHøØ€Oð	!ús   ‚'+ «%AÁAr7   c                óÞ   • [         R                  R                  n UR                  U 5      R                  n[        U 5      nU(       d  SU S3$ g ! [
        [        4[        -    a    0 n N4f = f)Nr9   r:   )	r   r;   r<   Úmanager_of_classÚmappersr@   Ú	TypeErrorÚNO_STATEr?   )r]   rF   r„   rG   s       r"   r\   r\   Ý   sw   € ä�>‰>×"Ñ"€DðØ×'Ñ'¨Ó,×4Ñ4ˆô ˜#Ó€DæØ˜˜˜oÐ.Ð.àøô 	Üðô 	ñó ð Šð	ús   œA ÁA,Á+A,N)r]   rz   rV   Ústr)r]   rz   rV   rT   ),r   Ú
__future__r   Útypingr   r   r   r   r   r	   r   r   Ú r   rf   r   r   Ú
interfacesr   r   rh   r   r   r~   ÚKeyErrorr†   ÚSQLAlchemyErrorr   ÚConcurrentModificationErrorr$   ÚArgumentErrorr'   rg   r*   r-   r0   r5   r@   rb   rm   rp   r?   rX   r\   r   r!   r"   Ú<module>r�      s@  ðñ !å "å Ý Ý Ý Ý  Ý å 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!   