관리-도구
편집 파일: exc.cpython-38.pyc
U -?�f� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z d d l mZ ddlm Z dd lm Z ddl mZ ddl mZ er�d dlmZ d dlmZ d dlmZ e ded�ZeefZG dd� dej�ZeZG dd� dej�ZG dd� dej�ZG dd� dej�Z G dd� dej�Z!G dd � d e�Z"G d!d"� d"e�Z#G d#d$� d$ej�Z$G d%d&� d&ej�Z%G d'd(� d(ej�Z&d)d*d+�d,d-�Z'e �(d.�d)d/d+�d0d1��Z)d2S )3zSQLAlchemy ORM exceptions.� )�annotations)�Any)�Optional)�Tuple)�Type)� TYPE_CHECKING)�TypeVar� )�_mapper_property_as_plain_name� )�exc)�util)�MultipleResultsFound)� NoResultFound)�LoaderStrategy)�MapperProperty)� InstanceState�_T)�boundc @ s e Zd ZdZdS )�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__� r r �B/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/orm/exc.pyr $ s r c @ s e Zd ZdZdS )� FlushErrorz0A invalid condition was detected during flush().Nr r r r r r @ s r c @ s e Zd ZdZdS )� UnmappedErrorz?Base for exceptions that involve expected mappings not present.Nr r r r r r D s r c @ s e Zd ZdZdS )�ObjectDereferencedErrorzPAn operation cannot complete due to an object being garbage collected. Nr r r r r r H s r c @ s e Zd ZdZdZdS )�DetachedInstanceErrorzSAn attempt to access unloaded attributes on a mapped instance that is detached.Zbhk3N)r r r r �coder r r r r O s r c @ s: e Zd ZdZe�d�d ddd�dd��Zd d �dd�ZdS )�UnmappedInstanceErrorz;An mapping operation was requested for an unknown instance.�sqlalchemy.orm.baseN�object� Optional[str])�obj�msgc C s� t jj}|szz*|�t|�� tt|��}d||f }W nB tk rx dtt|��� d�}t|t�rt|dt|� 7 }Y nX t� | |� d S )Nz�Class %r is mapped, but this instance lacks instrumentation. This occurs when the instance is created before sqlalchemy.orm.mapper(%s) was called.�Class '�' is not mappedz;; was a class (%s) supplied where an instance was required?) r � preloaded�orm_baseZclass_mapper�type�_safe_cls_name�UnmappedClassError� isinstancer �__init__)�selfr&