B ÃÌ4]Òã@sdZddlmZddlmZeefZGdd„dejƒZ e Z Gdd„dejƒZ Gdd „d ej ƒZ Gd d „d ejƒZGd d „d ejƒZGdd„de ƒZGdd„de ƒZGdd„dej ƒZGdd„dej ƒZGdd„dej ƒZGdd„dej ƒZGdd„dej ƒZdd„Ze d¡dd „ƒZd!S)"zSQLAlchemy ORM exceptions.é)Úexc)Úutilc@seZdZdZdS)ÚStaleDataErroraaAn 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__©r r úE/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/orm/exc.pyrsrc@seZdZdZdS)Ú FlushErrorz0A invalid condition was detected during flush().N)rrrrr r r r r -sr c@seZdZdZdS)Ú UnmappedErrorz?Base for exceptions that involve expected mappings not present.N)rrrrr r r r r 1sr c@seZdZdZdS)ÚObjectDereferencedErrorzPAn operation cannot complete due to an object being garbage collected. N)rrrrr r r r r 5sr c@seZdZdZdZdS)ÚDetachedInstanceErrorzSAn attempt to access unloaded attributes on a mapped instance that is detached.Zbhk3N)rrrrÚcoder r r r r<src@s,eZdZdZe d¡ddd„ƒZdd„ZdS) ÚUnmappedInstanceErrorz;An mapping operation was requested for an unknown instance.zsqlalchemy.orm.baseNcCsz|sjy*| t|ƒ¡tt|ƒƒ}d||f}Wn:tk rhtt|ƒƒ}t|tƒrd|dt|ƒ7}YnXt ||¡dS)Nz“Class %r is mapped, but this instance lacks instrumentation. This occurs when the instance is created before sqlalchemy.orm.mapper(%s) was called.z;; was a class (%s) supplied where an instance was required?)Z class_mapperÚtypeÚ_safe_cls_nameÚUnmappedClassErrorÚ_default_unmappedÚ isinstancer Ú__init__)ÚselfÚbaseÚobjÚmsgÚnamer r r rFs   zUnmappedInstanceError.__init__cCs|jd|jdffS)Né)Ú __class__Úargs)rr r r Ú __reduce__[sz UnmappedInstanceError.__reduce__)N)rrrrrÚ dependenciesrrr r r r rCs rc@s"eZdZdZddd„Zdd„ZdS)rz8An mapping operation was requested for an unknown class.NcCs|s t|ƒ}t ||¡dS)N)rr r)rÚclsrr r r rbszUnmappedClassError.__init__cCs|jd|jdffS)Nr)rr)rr r r rgszUnmappedClassError.__reduce__)N)rrrrrrr r r r r_s rc@s,eZdZdZe d¡ddd„ƒZdd„ZdS) Ú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.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. zsqlalchemy.orm.baseNcCs$|sd| |¡}tj ||¡dS)NzDInstance '%s' has been deleted, or its row is otherwise not present.)Z state_strÚsa_excÚInvalidRequestErrorr)rrÚstaterr r r rs zObjectDeletedError.__init__cCs|jd|jdffS)Nr)rr)rr r r r‰szObjectDeletedError.__reduce__)N)rrrrrr rrr r r r r"ks r"c@seZdZdZdS)ÚUnmappedColumnErrorz5Mapping operation was requested on an unknown column.N)rrrrr r r r r&sr&c@seZdZdZdS)Ú NoResultFoundz2A database result was required but none was found.N)rrrrr r r r r'‘sr'c@seZdZdZdS)ÚMultipleResultsFoundzCA single database result was required but more than one were found.N)rrrrr r r r r(•sr(c@seZdZdZdd„ZdS)ÚLoaderStrategyExceptionz2A loader strategy for an attribute does not exist.c CsP|dkr tj |d||f¡n,tj |dt |¡|t |¡t |¡f¡dS)NzCan't find strategy %s for %szuCan't apply "%s" strategy to property "%s", which is a "%s"; this loader strategy is intended to be used with a "%s".)r#r$rrZclsname_as_plain_name)rZapplied_to_property_typeZrequesting_propertyZ applies_toZactual_strategy_typeZ strategy_keyr r r rœsz LoaderStrategyException.__init__N)rrrrrr r r r r)™sr)cCsLyd |j|jf¡}Wn0tk rFt|ddƒ}|dkrBt|ƒ}YnX|S)NÚ.r)ÚjoinrrÚAttributeErrorÚgetattrÚrepr)r!Zcls_namer r r r¹s rzsqlalchemy.orm.basecCsXy| |¡j}Wn.tk r(i}Yntk r>i}YnXt|ƒ}|sTd|SdS)NzClass '%s' is not mapped)Zmanager_of_classÚmappersÚNO_STATEÚ TypeErrorr)rr!r/rr r r rÃs rN)rÚrr#rr,ÚKeyErrorr0ZSQLAlchemyErrorrZConcurrentModificationErrorr r$r r rrrr"r&r'r(r)rr rr r r r Ús$   "